/* Self-Service Onboarding — Greasebook Visual Language */

:root {
  --bg-dark: #0f1114;
  --bg-dark-card: #1a1d23;
  --bg-light: #fafaf9;
  --bg-light-alt: #f3f2ef;
  --text-dark: #0f1114;
  --text-light: #fafaf9;
  --text-muted: #6b7280;
  --accent: #51A69D;
  --accent-hover: #448f87;
  --accent-glow: rgba(81, 166, 157, 0.15);
  --red: #dc2626;
  --red-bg: rgba(220, 38, 38, 0.08);
  --green-bg: rgba(81, 166, 157, 0.08);
  --border: rgba(0,0,0,0.08);
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --max-w: 720px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-dark);
  background: var(--bg-light);
  -webkit-font-smoothing: antialiased;
}

/* Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(15,17,20,0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}
.nav-logo {
  height: 36px;
  width: auto;
}
.nav-title {
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  opacity: 0.7;
}

/* Layout */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 100px 24px 60px;
}

/* Page header */
.page-header {
  text-align: center;
  margin-bottom: 48px;
}
.step-label {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 12px;
}
.page-header p {
  color: var(--text-muted);
  font-size: 18px;
  max-width: 560px;
  margin: 0 auto;
}

/* Step indicator */
.steps-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;
}
.step-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.3s, transform 0.3s;
  cursor: pointer;
}
.step-dot:hover {
  transform: scale(1.3);
  opacity: 0.8;
}
.step-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}
.step-dot.completed {
  background: var(--accent);
  opacity: 0.5;
}
.step-dot.has-error {
  background: var(--red);
  opacity: 1;
}
.step-dot.active.has-error {
  background: var(--red);
}
.step-dot.has-warning {
  background: #d97706;
  opacity: 0.85;
}
.step-dot.active.has-warning {
  background: #d97706;
}

/* Cards */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 40px;
  margin-bottom: 24px;
}
.card h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 8px;
}
.card .subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 24px;
}

/* Step sections */
.step-section {
  display: none;
}
.step-section.active {
  display: block;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed rgba(0,0,0,0.15);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.drop-zone-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.4;
}
.drop-zone-text {
  font-size: 16px;
  color: var(--text-muted);
}
.drop-zone-text strong {
  color: var(--accent);
  cursor: pointer;
}
.drop-zone-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  opacity: 0.7;
}

/* File list */
.file-list {
  margin-top: 16px;
  list-style: none;
}
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-light-alt);
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 14px;
}
.file-item-name {
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-item-size {
  color: var(--text-muted);
  font-size: 13px;
  margin-left: 12px;
  flex-shrink: 0;
}
.file-item-remove {
  color: var(--text-muted);
  cursor: pointer;
  margin-left: 12px;
  font-size: 18px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.file-item-remove:hover {
  opacity: 1;
  color: var(--red);
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-secondary:hover {
  background: var(--accent-glow);
}

.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Start from scratch link */
.scratch-link {
  display: block;
  text-align: center;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s;
}
.scratch-link:hover { color: var(--accent); }

/* Progress */
.progress-section {
  text-align: center;
}
.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg-light-alt);
  border-radius: 4px;
  overflow: hidden;
  margin: 20px 0;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  width: 0%;
  transition: width 0.5s ease;
}
.progress-text {
  color: var(--text-muted);
  font-size: 15px;
}
.progress-file {
  font-weight: 500;
  color: var(--text-dark);
  margin-top: 4px;
  font-size: 14px;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Download section */
.download-section {
  text-align: center;
  padding: 32px 0;
}
.download-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.download-summary {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 24px;
}
.download-summary strong {
  color: var(--text-dark);
}

/* Error message */
.error-message {
  background: var(--red-bg);
  border: 1px solid rgba(220,38,38,0.2);
  border-radius: var(--radius);
  padding: 14px 18px;
  color: var(--red);
  font-size: 14px;
  margin-top: 16px;
}
.error-message:empty { display: none; }

/* Success */
.success-section {
  text-align: center;
  padding: 48px 0;
}
.success-icon {
  font-size: 56px;
  margin-bottom: 16px;
}
.success-section h2 {
  color: var(--accent);
  margin-bottom: 12px;
}
.success-section p {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
}

/* Validation list */
.validation-list {
  list-style: none;
  margin: 16px 0;
  text-align: left;
}
.validation-list li {
  padding: 8px 0;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.validation-list .pass { color: var(--accent); }
.validation-list .fail { color: var(--red); }
.validation-list .icon { flex-shrink: 0; }

/* ============================================================
   Form Fields (Gear Up v2)
   ============================================================ */

/* Form group */
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.form-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Text / email / tel inputs */
.form-input {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-dark);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}
.form-input.error {
  border-color: var(--red);
}

/* Select / dropdown */
.form-select {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-dark);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%236b7280'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Inline field row (e.g. first name + last name side by side) */
.field-row {
  display: flex;
  gap: 12px;
}
.field-row .form-group {
  flex: 1;
}

/* ============================================================
   Repeatable Groups
   ============================================================ */

.repeatable-group {
  margin-bottom: 16px;
}

.repeatable-entry {
  background: var(--bg-light-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  position: relative;
}
.repeatable-entry .entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.repeatable-entry .entry-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}
.repeatable-entry .entry-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s;
}
.repeatable-entry .entry-remove:hover {
  opacity: 1;
  color: var(--red);
}

.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px dashed rgba(0,0,0,0.15);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.btn-add:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* Toggle link (e.g. "Add backup contact") */
.toggle-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  margin-top: 8px;
  transition: color 0.2s;
}
.toggle-link:hover {
  color: var(--accent-hover);
}

/* Skip step link */
.skip-link {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}
.skip-link:hover {
  color: var(--accent);
}

/* ============================================================
   Review Step
   ============================================================ */

.review-section {
  margin-bottom: 24px;
}
.review-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.review-section-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
}
.review-edit-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}
.review-edit-btn:hover {
  color: var(--accent-hover);
}

.review-card {
  background: var(--bg-light-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.review-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
}
.review-row:last-child {
  border-bottom: none;
}
.review-row-label {
  color: var(--text-muted);
  font-size: 13px;
}
.review-row-value {
  font-weight: 500;
  text-align: right;
}
.review-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 14px;
  padding: 8px 0;
}

/* ============================================================
   Navigation Buttons (Back + Next)
   ============================================================ */

.step-nav {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}
.step-nav .btn {
  flex: 1;
}
.btn-back {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-back:hover {
  background: var(--bg-light-alt);
  color: var(--text-dark);
}

/* Submitting spinner overlay */
.submit-overlay {
  text-align: center;
  padding: 48px 0;
}

/* Field validation error text */
.field-error {
  color: var(--red);
  font-size: 13px;
  margin-top: 4px;
}

/* File upload checklist */
.file-checklist {
  background: var(--bg-light-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.checklist-heading {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
}
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 15px;
  color: var(--text-dark);
  cursor: pointer;
  transition: color 0.2s;
}
.checklist-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.checklist-item.error span {
  color: var(--red);
}
.checklist-item.error input[type="checkbox"] {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

/* Hidden file input */
.hidden { display: none; }

/* Responsive */
@media (max-width: 640px) {
  .container { padding: 80px 16px 40px; }
  .card { padding: 20px; }
  .page-header { margin-bottom: 32px; }
  .page-header h1 { font-size: 26px; }
  .page-header p { font-size: 16px; }
  .card h2 { font-size: 21px; }
  .card .subtitle { font-size: 14px; }

  /* Bigger tap targets for step dots on mobile */
  .steps-bar { gap: 14px; margin-bottom: 28px; }
  .step-dot { width: 14px; height: 14px; }

  .btn-group { flex-direction: column; }
  .btn { width: 100%; text-align: center; padding: 14px 20px; }
  .field-row { flex-direction: column; gap: 0; }
  .step-nav { flex-direction: column-reverse; }
  .step-nav .btn { width: 100%; text-align: center; }

  .repeatable-entry { padding: 16px; }
  .drop-zone { padding: 32px 16px; }
  .drop-zone-icon { font-size: 32px; }

  .file-item { padding: 8px 10px; font-size: 13px; }
  .file-item-name { min-width: 0; }

  .review-row { flex-direction: column; gap: 2px; }
  .review-row-value { text-align: left; }
}
