/* WBM Threshold Map - Dark Luxury CSS */

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

:root {
  --bg:        #0a0e1a;
  --surface:   #111827;
  --surface2:  #1a2236;
  --gold:      #c9a84c;
  --gold-dim:  #8a6d28;
  --text:      #e8e0d0;
  --text-dim:  #9b9080;
  --text-faint:#4a4438;
  --border:    #1e2a3a;
  --error:     #e05c5c;
  --radius:    12px;
  --radius-sm: 8px;
  --font-head: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --transition: 0.22s ease;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── Progress Bar ─── */
.progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px 8px;
}

.progress-track {
  height: 3px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 0%;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-body);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ─── Layout ─── */
.assessment-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 16px 40px;
}

/* ─── Step visibility ─── */
.step {
  display: none;
  width: 100%;
  max-width: 680px;
  animation: fadeIn 0.3s ease;
}

.step.active {
  display: flex;
  flex-direction: column;
  align-items: center;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Intro card ─── */
.intro-card {
  text-align: center;
  max-width: 540px;
  padding: 0 16px;
}

.logo-wrap {
  margin-bottom: 40px;
}

.logo {
  width: 120px;
  height: auto;
  opacity: 0.9;
}

.intro-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 300;
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.intro-sub {
  font-size: 1.05rem;
  color: var(--gold);
  margin-bottom: 24px;
  font-weight: 300;
  letter-spacing: 0.03em;
}

.intro-body {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-bottom: 48px;
  line-height: 1.7;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Section frame card ─── */
.frame-card {
  text-align: center;
  max-width: 540px;
  padding: 48px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
}

.frame-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 16px;
  font-family: var(--font-body);
}

.frame-title {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 300;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.2;
}

.frame-body {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Question card ─── */
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 40px 32px;
  width: 100%;
}

.step-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  margin-bottom: 14px;
}

.step-title {
  font-family: var(--font-head);
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 400;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 28px;
}

/* ─── Contact fields ─── */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field-group label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.field-group input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 16px;
  outline: none;
  transition: border-color var(--transition);
}

.field-group input:focus {
  border-color: var(--gold);
}

.field-group input::placeholder {
  color: var(--text-faint);
}

/* ─── Choice cards ─── */
.choice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.choice-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-dim);
  transition: border-color var(--transition), color var(--transition), box-shadow var(--transition);
  line-height: 1.5;
  user-select: none;
}

.choice-card:hover {
  border-color: var(--gold-dim);
  color: var(--text);
}

.choice-card.selected {
  border-color: var(--gold);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--gold), 0 0 12px rgba(201, 168, 76, 0.12);
  background: rgba(201, 168, 76, 0.05);
}

/* ─── Ranking ─── */
.rank-instruction {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-bottom: 16px;
  font-style: italic;
}

@media (min-width: 640px) {
  .mobile-only { display: none; }
}

@media (max-width: 639px) {
  .desktop-only { display: none; }
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: grab;
  transition: border-color var(--transition), box-shadow var(--transition);
  user-select: none;
}

.rank-item:active {
  cursor: grabbing;
}

.rank-item.sortable-ghost {
  opacity: 0.35;
}

.rank-item.sortable-chosen {
  border-color: var(--gold);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.15);
}

.rank-num {
  min-width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-body);
  font-weight: 500;
  flex-shrink: 0;
}

.rank-text {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.rank-arrows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.arrow-btn {
  width: 32px;
  height: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), color var(--transition);
  line-height: 1;
}

.arrow-btn:hover,
.arrow-btn:active {
  border-color: var(--gold);
  color: var(--gold);
}

/* Only show arrows on mobile */
@media (min-width: 640px) {
  .rank-arrows { display: none; }
}

/* ─── Navigation buttons ─── */
.step-nav {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.btn-primary {
  background: var(--gold);
  color: #0a0e1a;
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 28px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s;
}

.btn-primary:hover {
  background: #d9b85c;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 20px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.btn-secondary:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

/* ─── Error messages ─── */
.error-msg {
  font-size: 0.82rem;
  color: var(--error);
  min-height: 18px;
  margin-bottom: 12px;
  margin-top: -8px;
}

/* ─── Loading overlay ─── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.92);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.loading-overlay.visible {
  display: flex;
}

.loading-inner {
  text-align: center;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--surface2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-inner p {
  font-size: 0.9rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}

/* ─── Thankyou page ─── */
.thankyou-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.thankyou-card {
  text-align: center;
  max-width: 520px;
}

.thankyou-icon {
  width: 56px;
  height: 56px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 32px;
  font-size: 22px;
  color: var(--gold);
}

.thankyou-title {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 300;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.2;
}

.thankyou-body {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 20px;
}

.thankyou-note {
  font-size: 0.82rem;
  color: var(--text-faint);
  line-height: 1.6;
}

/* ─── Admin styles ─── */
.admin-body {
  background: #080c18;
  font-family: var(--font-body);
  color: var(--text);
  min-height: 100vh;
}

.admin-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 24px;
}

.admin-nav .brand {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--gold);
  font-weight: 400;
  text-decoration: none;
  margin-right: auto;
}

.admin-nav a {
  font-size: 0.82rem;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.admin-nav a:hover { color: var(--text); }

.admin-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
}

.admin-title {
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 32px;
}

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 2rem;
  font-family: var(--font-head);
  color: var(--gold);
  font-weight: 400;
  line-height: 1;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(30, 42, 58, 0.6);
  color: var(--text-dim);
  vertical-align: top;
}

.admin-table tr:hover td {
  background: rgba(201, 168, 76, 0.03);
}

.admin-table a {
  color: var(--gold);
  text-decoration: none;
}

.admin-table a:hover { text-decoration: underline; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-gold  { background: rgba(201,168,76,0.15); color: var(--gold); }
.badge-blue  { background: rgba(80,120,200,0.15); color: #6c9fe6; }
.badge-gray  { background: rgba(100,100,120,0.2); color: var(--text-dim); }

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.search-bar input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 16px;
  outline: none;
}

.search-bar input:focus { border-color: var(--gold); }

.search-bar button {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  padding: 10px 18px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color var(--transition);
}

.search-bar button:hover { border-color: var(--gold); color: var(--text); }

.pagination {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  align-items: center;
  justify-content: center;
}

.pagination a, .pagination span {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  border: 1px solid var(--border);
  color: var(--text-dim);
  text-decoration: none;
  transition: border-color var(--transition);
}

.pagination a:hover { border-color: var(--gold); color: var(--text); }
.pagination span.current { border-color: var(--gold); color: var(--gold); }

.flash-messages {
  list-style: none;
  margin-bottom: 20px;
}

.flash-messages li {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 8px;
}

.flash-success { background: rgba(60,160,80,0.15); color: #5dbd7a; border: 1px solid rgba(60,160,80,0.25); }
.flash-error   { background: rgba(220,80,80,0.12); color: #e05c5c; border: 1px solid rgba(220,80,80,0.2); }
.flash-info    { background: rgba(80,120,200,0.12); color: #6c9fe6; border: 1px solid rgba(80,120,200,0.2); }

.admin-form {
  max-width: 480px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--transition);
}

.form-group input:focus { border-color: var(--gold); }

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.admin-card h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.detail-value {
  font-size: 0.9rem;
  color: var(--text);
}

/* ─── Admin login ─── */
.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.admin-login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
}

.admin-login-card h1 {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 8px;
}

.admin-login-card .sub {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-bottom: 32px;
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .question-card {
    padding: 28px 20px 24px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .assessment-wrap {
    padding-top: 52px;
    align-items: flex-start;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .step-nav {
    justify-content: space-between;
  }

  .btn-primary, .btn-secondary {
    flex: 1;
    text-align: center;
  }
}
