/* =============================================================
   Kiddies Registration Portal — style.css
   Matches device UI: dark theme, pink accent, DM Sans font
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0d0d18;
  color: #e2e8f0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
}

/* ── Light mode ── */
body.light {
  background: #f8f4ff;
  color: #1a1a2e;
}
body.light::before {
  background:
    radial-gradient(ellipse 70% 45% at 15% 5%,  rgba(232,25,125,0.06) 0%, transparent 65%),
    radial-gradient(ellipse 55% 55% at 85% 90%, rgba(99,102,241,0.04) 0%, transparent 65%);
}
body.light .card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
body.light .field-input,
body.light .pin-cell,
body.light .otp-cell {
  background: #f0eefa;
  border-color: rgba(0,0,0,0.1);
  color: #1a1a2e;
}
body.light .info-box {
  background: rgba(232,25,125,0.06);
}
body.light .device-badge {
  background: #f0eefa;
  border-color: rgba(0,0,0,0.08);
}
body.light .success-detail {
  background: #f0eefa;
  border-color: rgba(0,0,0,0.08);
}
body.light .btn-ghost {
  border-color: rgba(0,0,0,0.15);
  color: #64748b;
}
body.light .card-sub,
body.light .field-hint,
body.light .field-label {
  color: #64748b;
}
body.light .site-footer { color: #94a3b8; }

/* ── Theme toggle button ── */
.theme-toggle {
  position: fixed;
  top: 16px; right: 16px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 0.5px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px;
  z-index: 100;
  transition: background 0.2s, border-color 0.2s;
  backdrop-filter: blur(8px);
}
body.light .theme-toggle {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.1);
}

/* Background glow */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 70% 45% at 15% 5%,  rgba(232,25,125,0.08) 0%, transparent 65%),
    radial-gradient(ellipse 55% 55% at 85% 90%, rgba(99,102,241,0.05) 0%, transparent 65%);
}

/* ── Layout ── */
.wrap {
  width: 100%; max-width: 460px;
  padding: 0 20px 60px;
  position: relative; z-index: 1;
}

/* ── Header ── */
.site-header {
  padding: 28px 0 0;
  text-align: center;
  margin-bottom: 28px;
}
.logo-img {
  height: 42px;
  object-fit: contain;
  display: block;
  margin: 0 auto 8px;
  filter: drop-shadow(0 2px 12px rgba(232,25,125,0.35));
}
.logo-tagline {
  font-size: 10px;
  color: rgba(232,25,125,0.7);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 500;
}
.portal-title {
  font-size: 11px;
  color: #475569;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-top: 16px;
  font-weight: 500;
}

/* ── Step indicator ── */
.steps {
  display: flex; align-items: center;
  margin: 0 0 24px;
}
.step { display: flex; align-items: center; gap: 6px; }
.step-dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  transition: all 0.3s ease;
}
.step-dot.active  { background: #E8197D; color: #fff; box-shadow: 0 0 14px rgba(232,25,125,0.5); }
.step-dot.done    { background: #10B981; color: #fff; }
.step-dot.pending { background: #1e1e32; color: #475569; border: 0.5px solid rgba(255,255,255,0.1); }
.step-lbl { font-size: 11px; font-weight: 500; white-space: nowrap; }
.step-lbl.active  { color: #e2e8f0; }
.step-lbl.pending { color: #475569; }
.step-line { flex: 1; height: 1px; background: rgba(255,255,255,0.08); margin: 0 6px; }
.step-line.done   { background: rgba(16,185,129,0.4); }

/* ── Card ── */
.card {
  background: #161628;
  border: 0.5px solid rgba(255,255,255,0.09);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.45);
  margin-bottom: 20px;
}
.card-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 16px;
}
.card-icon.pink { background: rgba(232,25,125,0.12); border: 0.5px solid rgba(232,25,125,0.3); }
.card-icon.green { background: rgba(16,185,129,0.12); border: 0.5px solid rgba(16,185,129,0.3); }
.card-title {
  font-size: 20px; font-weight: 700; letter-spacing: -0.4px;
  color: #e2e8f0; margin-bottom: 6px;
}
.card-sub {
  font-size: 13px; color: #64748b; line-height: 1.6; margin-bottom: 22px;
}
.card-sub strong { color: #94a3b8; font-weight: 600; }

/* ── Info box ── */
.info-box {
  background: rgba(232,25,125,0.08);
  border: 0.5px solid rgba(232,25,125,0.25);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px; color: #64748b; line-height: 1.65;
  margin-bottom: 20px;
}
.info-box strong { color: #E8197D; }
.info-mono { font-family: 'DM Mono', monospace; color: #94a3b8; font-size: 13px; }

/* ── Device badge ── */
.device-badge {
  background: #1e1e32;
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 22px;
  display: flex; align-items: center; gap: 12px;
}
.device-badge-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(232,25,125,0.12);
  border: 0.5px solid rgba(232,25,125,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.device-badge-uid {
  font-family: 'DM Mono', monospace;
  font-size: 14px; font-weight: 600; color: #E8197D; letter-spacing: 0.5px;
}
.device-badge-plan { font-size: 11px; color: #475569; margin-top: 2px; }

/* ── Form fields ── */
.field { margin-bottom: 16px; }
.field-label {
  display: block; font-size: 11px; font-weight: 600;
  color: #64748b; text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 7px;
}
.field-label .required { color: #E8197D; margin-left: 2px; }
.field-input {
  width: 100%;
  background: #1e1e32;
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px; font-family: 'DM Sans', sans-serif;
  color: #e2e8f0; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}
.field-input:focus {
  border-color: #E8197D;
  box-shadow: 0 0 0 3px rgba(232,25,125,0.1);
}
.field-input::placeholder { color: #334155; }
.field-input:disabled {
  opacity: 0.5; cursor: not-allowed;
}
.field-input.mono { font-family: 'DM Mono', monospace; letter-spacing: 1px; text-transform: uppercase; }
.field-hint { font-size: 11px; color: #334155; margin-top: 5px; line-height: 1.5; }
.field-readonly-note {
  font-size: 11px; color: #475569; margin-top: 5px;
  display: flex; align-items: center; gap: 4px;
}

/* ── PIN inputs ── */
.pin-row {
  display: flex; gap: 10px;
  justify-content: center;
  width: fit-content;
  margin: 0 auto;
}
.pin-cell {
  width: 58px; height: 62px;
  text-align: center;
  font-family: 'DM Mono', monospace;
  font-size: 22px; font-weight: 700; letter-spacing: 0;
  background: #1e1e32; border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 0;
  color: #E8197D; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pin-cell:focus {
  border-color: #E8197D;
  box-shadow: 0 0 0 3px rgba(232,25,125,0.1);
}

/* ── OTP digits ── */
.otp-row { display: flex; gap: 8px; justify-content: center; margin: 20px 0; }
.otp-cell {
  width: 46px; height: 56px;
  text-align: center;
  font-family: 'DM Mono', monospace;
  font-size: 24px; font-weight: 700;
  background: #1e1e32; border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 10px; color: #E8197D; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.otp-cell:focus {
  border-color: #E8197D;
  box-shadow: 0 0 0 3px rgba(232,25,125,0.1);
}
.otp-cell.filled { border-color: rgba(232,25,125,0.4); }

/* ── Buttons ── */
.btn {
  display: block; width: 100%; padding: 14px;
  border: none; border-radius: 12px;
  font-size: 15px; font-weight: 700; font-family: 'DM Sans', sans-serif;
  cursor: pointer; text-align: center; text-decoration: none;
  transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
  margin-top: 8px;
}
.btn-primary {
  background: #E8197D; color: #fff;
  box-shadow: 0 4px 20px rgba(232,25,125,0.35);
}
.btn-primary:hover  { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 6px 28px rgba(232,25,125,0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost {
  background: transparent; color: #64748b;
  border: 0.5px solid rgba(255,255,255,0.1);
  margin-top: 10px;
}
.btn-ghost:hover { color: #94a3b8; border-color: rgba(255,255,255,0.2); }
.btn-link {
  background: none; border: none; width: auto; display: inline;
  color: #E8197D; font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 0; font-family: 'DM Sans', sans-serif;
  text-decoration: underline; text-underline-offset: 3px;
}

/* ── Messages ── */
.msg {
  font-size: 12px; min-height: 18px; line-height: 1.5;
  padding: 0 2px; margin-top: 8px; border-radius: 6px;
}
.msg-error   { color: #F87171; }
.msg-success { color: #10B981; }
.msg-info    { color: #64748b; }
.msg-box {
  padding: 10px 14px; border-radius: 10px; margin-bottom: 16px;
}
.msg-box.error   { background: rgba(248,113,113,0.1); border: 0.5px solid rgba(248,113,113,0.3); color: #F87171; }
.msg-box.success { background: rgba(16,185,129,0.1);  border: 0.5px solid rgba(16,185,129,0.3);  color: #10B981; }

/* ── Divider ── */
.divider { border: none; border-top: 0.5px solid rgba(255,255,255,0.07); margin: 18px 0; }

/* ── OTP timer ── */
.otp-timer {
  text-align: center; font-size: 12px; color: #64748b;
  margin-bottom: 14px;
}
.otp-timer span { color: #e2e8f0; font-weight: 600; font-family: 'DM Mono', monospace; }
.otp-timer.expiring span { color: #F87171; }

/* ── Success page ── */
.success-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(16,185,129,0.12); border: 0.5px solid rgba(16,185,129,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; margin: 0 auto 20px;
  animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes popIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-detail {
  background: #1e1e32; border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 4px 16px; margin-bottom: 16px;
}
.detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 0; border-bottom: 0.5px solid rgba(255,255,255,0.06);
  font-size: 13px;
}
.detail-row:last-child { border-bottom: none; }
.detail-lbl { color: #64748b; }
.detail-val { color: #e2e8f0; font-weight: 500; text-align: right; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-val.pink { color: #E8197D; font-family: 'DM Mono', monospace; letter-spacing: 0.5px; }
.detail-val.green { color: #10B981; }
.verified-chip {
  display: inline-flex; align-items: center; gap: 3px;
  background: rgba(16,185,129,0.12); border: 0.5px solid rgba(16,185,129,0.3);
  border-radius: 5px; padding: 2px 7px;
  font-size: 10px; font-weight: 700; color: #10B981; margin-left: 6px;
}
.next-step-box {
  background: rgba(16,185,129,0.07); border: 0.5px solid rgba(16,185,129,0.2);
  border-radius: 10px; padding: 13px 15px;
  font-size: 12px; color: #64748b; line-height: 1.65; margin-bottom: 16px;
}
.next-step-box strong { color: #10B981; }

/* ── Spinner ── */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.25); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite;
  vertical-align: middle; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ── */
.site-footer {
  text-align: center; font-size: 11px; color: #334155;
  padding: 8px 0 32px;
  position: relative; z-index: 1;
}

/* ── data-theme="light" — set before page renders to prevent flash ── */
[data-theme="light"] body, body[data-theme="light"] { background:#f8f4ff; color:#1a1a2e; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .wrap { padding: 0 14px 60px; }
  .card { padding: 22px 18px; border-radius: 16px; }
  .otp-cell { width: 40px; height: 50px; font-size: 20px; }
}
