*, *::before, *::after { box-sizing: border-box; }

:root {
  --blue:    #2563eb;
  --blue-dk: #1d4ed8;
  --red:     #dc2626;
  --green:   #16a34a;
  --gray-50: #f9fafb;
  --gray-100:#f3f4f6;
  --gray-200:#e5e7eb;
  --gray-600:#4b5563;
  --gray-800:#1f2937;
  --radius:  6px;
}

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, sans-serif;
  color: var(--gray-800);
  background: var(--gray-50);
}

/* ── Navigation ──────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
}
.nav-brand a { font-weight: 700; font-size: 1.1rem; color: var(--blue); text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-links a { color: var(--gray-600); text-decoration: none; font-size: .9rem; }
.nav-links a:hover { color: var(--blue); }
.nav-user { font-size: .85rem; color: var(--gray-600); text-decoration: none; }
.nav-user:hover { color: var(--blue); }

/* ── Main ────────────────────────────────────── */
.main { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ── Footer ──────────────────────────────────── */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
  border-top: 1px solid var(--gray-200);
}
.footer__brand { font-weight: 700; color: var(--gray-600); }
.footer__links { display: flex; align-items: center; gap: 1.25rem; }
.footer__links a { color: var(--gray-600); text-decoration: none; font-size: .9rem; }
.footer__links a:hover { color: var(--blue); }

/* ── Flash ───────────────────────────────────── */
.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: .9rem; }
.flash-notice { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-alert  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Buttons ─────────────────────────────────── */
.btn-primary, a.btn-primary, button.btn-primary {
  display: inline-block;
  padding: .45rem 1rem;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .9rem;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
}
.btn-primary:hover { background: var(--blue-dk); }
.btn-primary:disabled, .btn-primary[disabled] {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-secondary, a.btn-secondary {
  display: inline-block;
  padding: .45rem 1rem;
  background: #fff;
  color: var(--gray-800);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .9rem;
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); }

.btn-danger, button.btn-danger {
  display: inline-block;
  padding: .45rem 1rem;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .9rem;
  cursor: pointer;
}

.btn-ghost, button.btn-ghost {
  background: none;
  border: none;
  color: var(--gray-600);
  font-size: .9rem;
  cursor: pointer;
  padding: 0;
}
.btn-ghost:hover { color: var(--red); }

/* ── Page header ─────────────────────────────── */
.page-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.5rem; }
.page-header h1 { margin: 0; font-size: 1.5rem; }

/* ── Tables ──────────────────────────────────── */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
th { text-align: left; padding: .65rem 1rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-600); background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
td { padding: .75rem 1rem; border-bottom: 1px solid var(--gray-100); font-size: .9rem; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* ── Cards ───────────────────────────────────── */
.card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.25rem; }
.card h2 { margin: 0 0 1rem; font-size: 1.1rem; }

/* ── Forms ───────────────────────────────────── */
.form-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 2rem; max-width: 860px; }
.form-section { margin-bottom: 2rem; }
.form-section h3 { margin: 0 0 1rem; font-size: .95rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-600); border-bottom: 1px solid var(--gray-200); padding-bottom: .5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .35rem; }
.field input[type=text],
.field input[type=url],
.field input[type=number],
.field textarea,
.field select {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: inherit;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.field .error { font-size: .8rem; color: var(--red); margin-top: .25rem; }

/* Checkbox grid for demographic requirements */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .4rem; }
.check-grid label { display: flex; align-items: center; gap: .4rem; font-size: .875rem; cursor: pointer; }
.check-grid input[type=checkbox] { cursor: pointer; }

/* ── Status badges ───────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-pending     { background: #fef3c7; color: #92400e; }
.badge-active      { background: #dcfce7; color: #166534; }
.badge-in_progress { background: #dbeafe; color: #1e40af; }
.badge-completed   { background: #f3f4f6; color: #374151; }
.badge-archived    { background: #f1f5f9; color: #64748b; }
.badge-cancelled   { background: #fee2e2; color: #991b1b; }
.badge-customer    { background: #ede9fe; color: #5b21b6; }
.badge-tester      { background: #e0f2fe; color: #0369a1; }
.badge-admin       { background: #fce7f3; color: #9d174d; }
.badge-tester_manager { background: #f0fdf4; color: #166534; }
.badge-assigned    { background: #dcfce7; color: #166534; }
.badge-in_progress { background: #dbeafe; color: #1e40af; }
.badge-submitted   { background: #fef9c3; color: #854d0e; }
.badge-accepted    { background: #dcfce7; color: #166534; }
.badge-rejected    { background: #fee2e2; color: #991b1b; }
.badge-registered-admin { background: #fef3c7; color: #9a3412; }

/* ── Detail layout ───────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 640px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-meta dt { font-size: .8rem; color: var(--gray-600); text-transform: uppercase; letter-spacing: .04em; }
.detail-meta dd { margin: 0 0 .75rem; font-weight: 500; }

/* ── Empty state ─────────────────────────────── */
.empty { text-align: center; padding: 3rem 1rem; color: var(--gray-600); }
.empty p { margin: .5rem 0 1rem; }

/* ── Admin section ───────────────────────────────────────────────────────── */
.admin-nav {
  display: flex;
  gap: .25rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: .375rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.admin-nav a {
  padding: .45rem 1rem;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}

.admin-nav a:hover { background: var(--gray-50); color: var(--gray-800); }
.admin-nav a.active { background: var(--blue); color: #fff; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 1.25rem 1rem;
  text-align: center;
}

.stat-card__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue);
  line-height: 1;
  margin-bottom: .3rem;
}

.stat-card__label {
  font-size: .75rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .05em;
}

[data-theme="dark"] .admin-nav { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .admin-nav a { color: #cdf; }
[data-theme="dark"] .admin-nav a:hover { background: #334155; color: #f1f5f9; }
[data-theme="dark"] .admin-nav a.active { background: #3b82f6; color: #fff; }
[data-theme="dark"] .stat-card { background: #1e293b; border-color: #334155; }

/* ── Auth (login) page ───────────────────────────────────────────────────── */
.auth-page {
  min-height: 60vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
}

.auth-card__header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 0 0 .375rem;
}

.auth-card__subtitle {
  font-size: .875rem;
  color: var(--gray-600);
  margin: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group--checkbox {
  flex-direction: row;
  align-items: center;
  gap: .5rem;
}

.form-checkbox {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: var(--blue);
}

.form-checkbox-label {
  font-size: .875rem;
  color: var(--gray-800);
  cursor: pointer;
}

.form-actions { margin-top: .25rem; }

.btn-full { width: 100%; text-align: center; display: block; }

.auth-card__footer {
  margin-top: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: .375rem;
}

.auth-card__footer p {
  font-size: .875rem;
  color: var(--gray-600);
  margin: 0;
}

.auth-link { color: var(--blue); text-decoration: none; font-weight: 600; }
.auth-link:hover { text-decoration: underline; }

/* ── Theme toggle button ─────────────────────────────────────────────────── */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: .35rem;
  border-radius: var(--radius);
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s ease, background .15s ease;
}
.theme-toggle:hover { color: var(--gray-800); background: var(--gray-100); }
.theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__moon { display: none; }
[data-theme="dark"] .theme-toggle__sun  { display: block; }

/* ── Dark mode ───────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --gray-50:  #0f172a;
  --gray-100: #1e293b;
  --gray-200: #334155;
  --gray-600: #94a3b8;
  --gray-800: #f1f5f9;
}

[data-theme="dark"] body {
  background: #0f172a;
  color: #f1f5f9;
}

[data-theme="dark"] .nav {
  background: #1e293b;
  border-bottom-color: #334155;
}

[data-theme="dark"] .footer { border-top-color: #334155; }
[data-theme="dark"] .footer__brand { color: #94a3b8; }
[data-theme="dark"] .footer__links a { color: #94a3b8; }
[data-theme="dark"] .footer__links a:hover { color: #fff; }

[data-theme="dark"] a { color: #cdf; }
[data-theme="dark"] .nav-brand a { color: #60a5fa; }
[data-theme="dark"] .nav-links a { color: #cdf; }
[data-theme="dark"] .nav-links a:hover { color: #fff; }
[data-theme="dark"] .nav-user { color: #94a3b8; }
[data-theme="dark"] .theme-toggle:hover { background: #334155; color: #f1f5f9; }

[data-theme="dark"] .card,
[data-theme="dark"] .dash-card,
[data-theme="dark"] .form-card,
[data-theme="dark"] .onboarding-section {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] table { background: #1e293b; }
[data-theme="dark"] th { background: #0f172a; border-bottom-color: #334155; color: #94a3b8; }
[data-theme="dark"] td { border-bottom-color: #1e293b; }
[data-theme="dark"] tr:hover td { background: #0f172a; }

[data-theme="dark"] .btn-secondary {
  background: #1e293b;
  color: #f1f5f9;
  border-color: #334155;
}
[data-theme="dark"] .btn-secondary:hover { border-color: #60a5fa; color: #60a5fa; }

[data-theme="dark"] .flash-notice { background: #14532d; color: #86efac; border-color: #166534; }
[data-theme="dark"] .flash-alert  { background: #450a0a; color: #fca5a5; border-color: #991b1b; }

[data-theme="dark"] .badge-pending     { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .badge-active      { background: #14532d; color: #86efac; }
[data-theme="dark"] .badge-in_progress { background: #1e3a8a; color: #93c5fd; }
[data-theme="dark"] .badge-completed   { background: #1e293b; color: #94a3b8; }
[data-theme="dark"] .badge-archived    { background: #0f172a; color: #64748b; }
[data-theme="dark"] .badge-cancelled   { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .badge-registered-admin { background: #451a03; color: #fdba74; }

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}
[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(96,165,250,.15); }
[data-theme="dark"] .form-input::placeholder { color: #475569; opacity: 1; }

[data-theme="dark"] .option-label {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}
[data-theme="dark"] .option-label:hover { background: #0f172a; border-color: #94a3b8; }
[data-theme="dark"] .option-card input:checked + .option-label { background: rgba(96,165,250,.1); border-color: #60a5fa; }

[data-theme="dark"] .onboarding-section__header { border-bottom-color: #334155; }
[data-theme="dark"] .onboarding-section__badge  { background: #3b82f6; }
[data-theme="dark"] .onboarding-section__title  { color: #f1f5f9; }

[data-theme="dark"] .field input[type=text],
[data-theme="dark"] .field input[type=url],
[data-theme="dark"] .field input[type=number],
[data-theme="dark"] .field textarea,
[data-theme="dark"] .field select {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

[data-theme="dark"] .detail-meta dt { color: #94a3b8; }
[data-theme="dark"] .empty { color: #94a3b8; }

[data-theme="dark"] .auth-card {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 24px rgba(0,0,0,.3);
}
[data-theme="dark"] .auth-card__title { color: #f1f5f9; }
[data-theme="dark"] .auth-card__subtitle { color: #94a3b8; }
[data-theme="dark"] .auth-card__footer p { color: #94a3b8; }
[data-theme="dark"] .auth-link { color: #cdf; }
[data-theme="dark"] .form-checkbox-label { color: #f1f5f9; }

/* ── Onboarding-style form (New / Edit Test) ─────────────────────────────── */
.onboarding-wrap {
  max-width: 860px;
  margin: 0 auto;
}

.onboarding-section {
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  padding: 1.75rem 2rem;
  margin-bottom: 1.25rem;
}

.onboarding-section__header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200);
}

.onboarding-section__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
  flex-shrink: 0;
}

.onboarding-section__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 0;
}

.onboarding-section__subtitle {
  font-size: .8rem;
  font-weight: 400;
  color: var(--gray-600);
  margin-left: .4rem;
}

.onboarding-question {
  margin-bottom: 1.25rem;
}

.onboarding-question:last-child {
  margin-bottom: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: .375rem;
}

.form-group--row {
  flex-direction: row;
  gap: 1rem;
}

.form-group--row > .form-group {
  flex: 1;
  min-width: 0;
}

.form-label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
}

.form-input,
.form-select {
  width: 100%;
  padding: .625rem .875rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: inherit;
  color: var(--gray-800);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
  line-height: 1.5;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.form-input::placeholder { color: var(--gray-600); opacity: .7; }
textarea.form-input { min-height: 90px; resize: vertical; }

.option-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-top: .4rem;
}

.option-list--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .4rem;
}

.option-card { position: relative; }

.option-card input[type="radio"],
.option-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.option-label {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .875rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  background: #fff;
  transition: border-color .15s ease, background .15s ease;
  user-select: none;
  font-size: .875rem;
  color: var(--gray-800);
  line-height: 1.4;
}

.option-label:hover {
  border-color: var(--gray-600);
  background: var(--gray-50);
}

.option-card input:checked + .option-label {
  border-color: var(--blue);
  background: rgba(37,99,235,.06);
}

.option-indicator {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease, background .15s ease;
}

.option-indicator--radio  { border-radius: 50%; }
.option-indicator--checkbox { border-radius: 3px; }

.option-indicator--checkbox::after {
  content: '';
  width: .3rem;
  height: .55rem;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0;
  transition: opacity .15s ease;
}

.option-card input:checked + .option-label .option-indicator {
  border-color: var(--blue);
  background: var(--blue);
}

.option-card input:checked + .option-label .option-indicator::after {
  opacity: 1;
}

.onboarding-submit {
  display: flex;
  gap: .75rem;
  align-items: center;
  padding: .5rem 0 1.5rem;
}

/* ── Dashboard grid ──────────────────────────── */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.dash-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.25rem; }
.dash-card h3 { margin: 0 0 .5rem; font-size: 1rem; }
.dash-card p  { margin: 0; font-size: .875rem; color: var(--gray-600); }
.dash-card .dash-footer { margin-top: 1rem; font-size: .8rem; color: var(--gray-600); display: flex; justify-content: space-between; align-items: center; }

/* ── Video processing states ─────────────────── */
.video-processing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  background: var(--gray-100);
  border-radius: var(--radius);
}
.video-processing__inner { text-align: center; }
.video-processing__spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.video-processing__label {
  margin: .625rem 0 0;
  font-size: .875rem;
  color: var(--gray-600);
}
.badge-pending    { background: #fef3c7; color: #92400e; }
.badge-processing { background: #dbeafe; color: #1e40af; }
.badge-ready      { background: #dcfce7; color: #166534; }
.badge-failed     { background: #fee2e2; color: #991b1b; }
[data-theme="dark"] .video-processing { background: #1e293b; }
[data-theme="dark"] .video-processing__spinner { border-color: #334155; border-top-color: var(--blue); }
[data-theme="dark"] .badge-pending    { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .badge-processing { background: #1e3a8a; color: #93c5fd; }
[data-theme="dark"] .badge-ready      { background: #14532d; color: #86efac; }
[data-theme="dark"] .badge-failed     { background: #450a0a; color: #fca5a5; }

/* ── Upload progress bar ─────────────────────── */
.upload-progress {
  margin-top: .75rem;
}
.upload-progress__track {
  height: 6px;
  background: var(--gray-200);
  border-radius: 99px;
  overflow: hidden;
}
.upload-progress__bar {
  height: 100%;
  width: 0%;
  background: var(--blue);
  border-radius: 99px;
  transition: width .1s ease;
}
.upload-progress__label {
  display: flex;
  justify-content: space-between;
  font-size: .8125rem;
  color: var(--gray-600);
  margin-top: .25rem;
}
[data-theme="dark"] .upload-progress__track { background: #334155; }

/* ── File drop zone ──────────────────────────── */
.file-drop-zone { position: relative; margin-top: .375rem; }

.file-drop-zone__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.file-drop-zone__area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1.75rem 1.5rem;
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  text-align: center;
  min-height: 7rem;
  user-select: none;
}

.file-drop-zone__area:hover {
  border-color: var(--gray-600);
  background: var(--gray-50);
}

.file-drop-zone--over .file-drop-zone__area {
  border-color: var(--blue);
  border-style: solid;
  background: rgba(37,99,235,.06);
}

.file-drop-zone--selected .file-drop-zone__area {
  border-color: var(--blue);
  border-style: solid;
  background: rgba(37,99,235,.06);
}

.file-drop-zone__icon {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--gray-600);
  transition: color .15s ease;
  flex-shrink: 0;
}

.file-drop-zone__area:hover .file-drop-zone__icon,
.file-drop-zone--over .file-drop-zone__icon,
.file-drop-zone--selected .file-drop-zone__icon { color: var(--blue); }

.file-drop-zone__prompt {
  font-size: .875rem;
  color: var(--gray-600);
  margin: 0;
}

.file-drop-zone__prompt span {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.file-drop-zone__filename {
  font-size: .8125rem;
  color: var(--gray-600);
  font-style: italic;
  margin: 0;
  word-break: break-all;
}

[data-theme="dark"] .file-drop-zone__area {
  background: #1e293b;
  border-color: #334155;
}
[data-theme="dark"] .file-drop-zone__area:hover { background: #0f172a; border-color: #475569; }
[data-theme="dark"] .file-drop-zone--over .file-drop-zone__area,
[data-theme="dark"] .file-drop-zone--selected .file-drop-zone__area {
  background: rgba(37,99,235,.12);
  border-color: var(--blue);
}

/* ── Toggle switch ───────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 0;
}
.toggle-label {
  font-weight: 600;
  font-size: .9375rem;
}
.toggle-description {
  font-size: .8125rem;
  color: var(--gray-600);
  margin-top: .125rem;
}
.toggle-switch {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--gray-200);
  border-radius: 99px;
  transition: background .2s ease;
}
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s ease;
}
.toggle-switch input:checked ~ .toggle-track { background: var(--blue); }
.toggle-switch input:checked ~ .toggle-thumb { transform: translateX(20px); }
.toggle-switch input:focus-visible ~ .toggle-track { outline: 2px solid var(--blue); outline-offset: 2px; }

.badge-on  { background: #dcfce7; color: #166534; border-radius: 99px; padding: .15rem .65rem; font-size: .8rem; font-weight: 600; }
.badge-off { background: var(--gray-100); color: var(--gray-600); border-radius: 99px; padding: .15rem .65rem; font-size: .8rem; font-weight: 600; }

[data-theme="dark"] .toggle-track { background: #334155; }
[data-theme="dark"] .toggle-switch input:checked ~ .toggle-track { background: var(--blue); }
[data-theme="dark"] .badge-on  { background: #14532d; color: #86efac; }
[data-theme="dark"] .badge-off { background: #1e293b; color: #94a3b8; }

/* ── Credit / Payments ───────────────────────────────────────────────────── */
.nav-credit {
  font-size: .85rem;
  font-weight: 600;
  color: var(--green);
  background: #dcfce7;
  padding: .2rem .65rem;
  border-radius: 99px;
}
[data-theme="dark"] .nav-credit { background: #14532d; color: #86efac; }

.page-header__sub { margin: .25rem 0 0; color: var(--gray-600); font-size: .95rem; }

.credit-form { max-width: 560px; }

.credit-amounts {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.amount-btn {
  padding: .5rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  background: #fff;
  color: var(--gray-800);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.amount-btn:hover { border-color: var(--blue); color: var(--blue); }
.amount-btn.active { border-color: var(--blue); background: var(--blue); color: #fff; }

[data-theme="dark"] .amount-btn { background: #1e293b; border-color: #334155; color: #f1f5f9; }
[data-theme="dark"] .amount-btn:hover { border-color: #60a5fa; color: #60a5fa; }
[data-theme="dark"] .amount-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.credit-custom { margin-top: .25rem; }
.credit-custom__input-wrap { position: relative; display: inline-flex; align-items: center; }
.credit-custom__symbol {
  position: absolute;
  left: .75rem;
  color: var(--gray-600);
  font-weight: 600;
  pointer-events: none;
}
.credit-custom__input { padding-left: 1.75rem; max-width: 180px; }

.stripe-element-placeholder {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 56px;
  background: #fff;
}
[data-theme="dark"] .stripe-element-placeholder { background: #1e293b; border-color: #334155; }
.stripe-element-loading { color: var(--gray-600); font-size: .9rem; margin: 0; }

.credit-error {
  color: var(--red);
  font-size: .9rem;
  margin-top: .5rem;
}

.btn-pay { min-width: 130px; }

/* ── Profile page ────────────────────────────────────────────────────────── */
.profile-readonly-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: .9rem;
}
.profile-readonly-row:last-child { border-bottom: none; }
.profile-readonly-label { color: var(--gray-600); min-width: 110px; flex-shrink: 0; }
.profile-readonly-value { color: var(--gray-800); font-weight: 500; }
.profile-credit { color: var(--green); }

[data-theme="dark"] .profile-readonly-row { border-bottom-color: #334155; }
[data-theme="dark"] .profile-readonly-value { color: #f1f5f9; }
[data-theme="dark"] .nav-user { color: #94a3b8; }
[data-theme="dark"] .nav-user:hover { color: #cdf; }

/* ── Public homepage ─────────────────────────────────────────────────────── */
.public-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
  padding: 4rem 0 3rem;
  min-height: calc(100vh - 56px - 140px);
}

.public-hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
}

.public-hero__label {
  display: inline-block;
  background: #ccfbf1;
  color: #0d9488;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .35rem .9rem;
  border-radius: 99px;
}

.public-hero__heading {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.12;
  color: #0f172a;
  margin: 0;
  letter-spacing: -.02em;
}

.public-hero__subtext {
  font-size: 1.05rem;
  color: #64748b;
  line-height: 1.65;
  max-width: 440px;
  margin: 0;
}

.public-hero__cta {
  display: inline-block;
  background: #0f172a;
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  padding: .75rem 1.6rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background .15s;
}
.public-hero__cta:hover { background: #1e293b; color: #fff; }

.public-hero__illustration {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--gray-100);
}
.public-hero__video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Social proof / stats strip ─────────────────────────────────────────── */
.public-trust {
  border-top: 1px solid var(--gray-200);
  padding: 2rem 0;
}

.public-trust__label {
  font-size: .82rem;
  color: #94a3b8;
  margin: 0 0 1.25rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 500;
}

.public-trust__stats {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.public-trust__stat {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.public-trust__stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -.02em;
}

.public-trust__stat-name {
  font-size: .8rem;
  color: #94a3b8;
  font-weight: 500;
}

.public-trust__divider {
  width: 1px;
  height: 36px;
  background: var(--gray-200);
  flex-shrink: 0;
}

/* dark mode */
[data-theme="dark"] .public-hero__label { background: #134e4a; color: #5eead4; }
[data-theme="dark"] .public-hero__heading { color: #f1f5f9; }
[data-theme="dark"] .public-hero__cta { background: #f1f5f9; color: #0f172a; }
[data-theme="dark"] .public-hero__cta:hover { background: #fff; color: #0f172a; }
[data-theme="dark"] .public-trust { border-top-color: #334155; }
[data-theme="dark"] .public-trust__stat-value { color: #f1f5f9; }
[data-theme="dark"] .public-trust__divider { background: #334155; }

/* ── Tester CTA band ─────────────────────────────────────────────────────── */
.public-tester-cta {
  background: #0f172a;
  border-radius: var(--radius);
  margin-top: 3rem;
  padding: 3rem 2.5rem;
}

.public-tester-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.public-tester-cta__content {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-width: 560px;
}

.public-tester-cta__label {
  display: inline-block;
  background: rgba(45, 212, 191, .15);
  color: #2dd4bf;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .3rem .85rem;
  border-radius: 99px;
  width: fit-content;
}

.public-tester-cta__heading {
  font-size: 1.75rem;
  font-weight: 800;
  color: #f1f5f9;
  margin: 0;
  letter-spacing: -.02em;
}

.public-tester-cta__subtext {
  font-size: .95rem;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0;
}

.public-tester-cta__btn {
  display: inline-block;
  background: #2dd4bf;
  color: #0f172a;
  font-size: .95rem;
  font-weight: 700;
  padding: .8rem 1.75rem;
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s;
}
.public-tester-cta__btn:hover { background: #5eead4; color: #0f172a; }

[data-theme="dark"] .public-tester-cta { background: #1e293b; border: 1px solid #334155; }
[data-theme="dark"] .public-tester-cta__btn { color: #0f172a; }
[data-theme="dark"] .public-tester-cta__btn:hover { color: #0f172a; }

/* ── Three-column image gallery ──────────────────────────────────────────── */
.public-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.public-gallery__item {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--gray-100);
}

.public-gallery__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

[data-theme="dark"] .public-gallery__item { background: #1e293b; border: 1px solid #334155; }

/* ── Wider auth card (tester registration) ───────────────────────────────── */
.auth-card--wide { max-width: 480px; }

/* responsive */
@media (max-width: 1024px) {
  .public-gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .public-hero { grid-template-columns: 1fr; padding: 2.5rem 0 2rem; }
  .public-hero__illustration { display: none; }
  .public-hero__heading { font-size: 2.2rem; }
  .public-trust__stats { flex-wrap: wrap; gap: 1.25rem; }
  .public-trust__divider { display: none; }
  .public-tester-cta__inner { flex-direction: column; align-items: flex-start; }
  .public-tester-cta__btn { width: 100%; text-align: center; }
  .public-gallery { grid-template-columns: 1fr; }
}
