:root {
  --bg-deep: #0b051f;
  --bg-main: #11092b;
  --bg-card: #190e3c;
  --bg-card-alt: #21134d;
  --border-subtle: rgba(168, 85, 247, 0.25);
  --border-gold: rgba(245, 166, 35, 0.55);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-gold: #f5a623;
  --accent-gold-bright: #ffb834;
  --accent-purple: #9333ea;
  --accent-green: #22c55e;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-blue: #38bdf8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top center, #28125a 0%, #11092b 58%, #080416 100%);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hidden {
  display: none !important;
}

.kyc-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 18px 56px;
}

/* Top Navbar */
.kyc-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: rgba(25, 14, 60, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  margin-bottom: 20px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.15s ease;
}

.nav-back:hover {
  background: rgba(245, 166, 35, 0.16);
  border-color: var(--border-gold);
}

.brand-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.9px;
  color: var(--accent-gold-bright);
  text-transform: uppercase;
}

.nav-title {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.nav-chip:hover {
  border-color: var(--border-gold);
  color: #fff;
}

.nav-chip.gold {
  border-color: var(--border-gold);
  background: rgba(245, 166, 35, 0.14);
  color: var(--accent-gold-bright);
}

.download-app-btn,
.mobile-only-download-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.28);
  cursor: pointer;
}

@media (max-width: 768px), (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  .download-app-btn,
  .mobile-only-download-btn {
    display: inline-flex;
    min-height: 42px;
  }
}

html.is-mobile-device .download-app-btn,
html.is-mobile-device .mobile-only-download-btn {
  display: inline-flex;
}

html.is-desktop-device .download-app-btn,
html.is-desktop-device .mobile-only-download-btn {
  display: none;
}

/* Banners */
.kyc-banner {
  padding: 13px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.kyc-banner.info {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.45);
  color: #bbf7d0;
}

.kyc-banner.warn {
  background: rgba(245, 166, 35, 0.14);
  border-color: rgba(245, 166, 35, 0.55);
  color: #fde68a;
}

.kyc-banner.error {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.55);
  color: #fecaca;
}

/* Cards */
.card {
  background: linear-gradient(180deg, rgba(27, 14, 66, 0.96) 0%, rgba(18, 9, 46, 0.98) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  margin-bottom: 18px;
}

.card.gold-border {
  border-color: var(--border-gold);
}

/* Auth gate */
.auth-gate-card {
  max-width: 560px;
  margin: 40px auto;
  text-align: center;
}

.auth-gate-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
}

.auth-gate-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* Dashboard Standing Hero */
.standing-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 820px) {
  .standing-grid {
    grid-template-columns: 1fr;
  }
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.status-pill.approved {
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.55);
  color: #4ade80;
}

.status-pill.pending {
  background: rgba(245, 166, 35, 0.18);
  border: 1px solid rgba(245, 166, 35, 0.55);
  color: #ffb834;
}

.status-pill.review {
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #7dd3fc;
}

.status-pill.danger {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #fca5a5;
}

.status-pill.muted {
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

.ref-box {
  background: var(--bg-deep);
  border: 1px dashed var(--border-gold);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--accent-gold-bright);
}

.meta-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.meta-tile {
  background: rgba(11, 5, 31, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
}

.meta-tile .k {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.meta-tile .v {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}

.steps-checklist-box {
  background: rgba(11, 5, 31, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px;
}

.steps-checklist-box h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-gold-bright);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.req-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.req-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.req-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gold);
  flex-shrink: 0;
}

.req-dot.done {
  background: var(--accent-green);
}

/* 5-Step Progress Stepper */
.wizard-stepper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

@media (max-width: 720px) {
  .wizard-stepper {
    grid-template-columns: repeat(2, 1fr);
  }
}

.step-pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(19, 9, 49, 0.8);
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}

.step-pill-btn:hover {
  border-color: rgba(245, 166, 35, 0.55);
  color: #fff;
}

.step-pill-btn.active {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.35), rgba(245, 166, 35, 0.18));
  border-color: var(--accent-gold);
  color: #ffffff;
}

.step-pill-btn.completed {
  border-color: rgba(34, 197, 94, 0.55);
  color: #bbf7d0;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 800;
  flex-shrink: 0;
}

.step-pill-btn.active .step-num {
  background: var(--accent-gold);
  color: var(--bg-main);
}

.step-pill-btn.completed .step-num {
  background: var(--accent-green);
  color: #06210f;
}

.step-label-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.step-kicker {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  opacity: 0.8;
}

.step-name {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Forms & Country Search */
.section-title {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 800;
}

.section-sub {
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 680px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: var(--bg-deep);
  color: #ffffff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent-gold);
}

.field-hint {
  font-size: 11.5px;
  color: var(--text-muted);
}

.field-error {
  font-size: 11.5px;
  color: #fca5a5;
  font-weight: 600;
}

/* Country Picker & Doc Type Cards */
.country-picker-box {
  background: rgba(11, 5, 31, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 18px;
}

.country-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 10px;
  padding-right: 4px;
}

.country-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.country-opt.selected {
  border-color: var(--accent-gold);
  background: rgba(245, 166, 35, 0.15);
  color: #ffffff;
}

.doc-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 680px) {
  .doc-type-grid {
    grid-template-columns: 1fr;
  }
}

.doc-type-card {
  padding: 16px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(11, 5, 31, 0.65);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.doc-type-card:hover {
  border-color: rgba(245, 166, 35, 0.6);
}

.doc-type-card.selected {
  border-color: var(--accent-gold);
  background: rgba(245, 166, 35, 0.13);
  box-shadow: 0 0 22px rgba(245, 166, 35, 0.18);
}

.doc-type-card h4 {
  margin: 0 0 5px;
  font-size: 14.5px;
  font-weight: 800;
}

.doc-type-card p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.rule-chip {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(147, 51, 234, 0.25);
  border: 1px solid rgba(192, 132, 252, 0.45);
  font-size: 11px;
  font-weight: 700;
  color: #e9d5ff;
}

/* Camera & Upload Slots */
.capture-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 720px) {
  .capture-grid {
    grid-template-columns: 1fr;
  }
}

.media-slot-card {
  background: rgba(11, 5, 31, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 16px;
}

.media-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.media-slot-header h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
}

.preview-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px dashed rgba(245, 166, 35, 0.45);
  background: #060312;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.preview-frame.selfie-frame {
  max-width: 420px;
  margin: 0 auto 14px;
  aspect-ratio: 4 / 3;
}

.preview-frame img,
.preview-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-placeholder {
  text-align: center;
  padding: 16px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.camera-guide-rect {
  position: absolute;
  inset: 12%;
  border: 2px dashed rgba(245, 166, 35, 0.85);
  border-radius: 12px;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.25);
}

.camera-guide-oval {
  position: absolute;
  width: 52%;
  height: 78%;
  border: 2.5px dashed rgba(34, 197, 94, 0.9);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
}

/* Buttons */
.btn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

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

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-gold {
  background: linear-gradient(135deg, #f5a623 0%, #ea8c00 100%);
  color: #11092b;
}

.btn-green {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff;
}

.btn-purple {
  background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
  color: #ffffff;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
}

.btn-sm {
  min-height: 38px;
  padding: 7px 13px;
  font-size: 12.5px;
}

.wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Review Table */
.review-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.review-media-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 680px) {
  .review-media-row {
    grid-template-columns: 1fr;
  }
}

.consent-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(147, 51, 234, 0.12);
  border: 1px solid rgba(192, 132, 252, 0.35);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.consent-box input[type='checkbox'] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent-gold);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 2, 15, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-card {
  max-width: 440px;
  width: 100%;
  background: var(--bg-card);
  border: 1.5px solid var(--border-gold);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.modal-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 800;
}

.modal-card p {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

@media (max-width: 540px) {
  .kyc-shell {
    padding: 12px 10px 44px;
  }

  .kyc-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .nav-links {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .wizard-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .wizard-footer .btn-row {
    width: 100%;
    flex-direction: column;
  }

  .wizard-footer .btn,
  .btn-row .btn {
    width: 100%;
    justify-content: center;
  }

  .doc-type-grid,
  .meta-tiles,
  .capture-grid {
    grid-template-columns: 1fr;
  }
}

