/* ============ Laboong · Đăng ký tài khoản (FR-001) ============ */

:root {
  --brand: #0F623F;
  --brand-deep: #07432A;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, #fff);
  --brand-ink: color-mix(in srgb, var(--brand) 68%, #000);

  --peach: #FF8A5B; --yellow: #FFC23D; --pink: #FF6FA5;
  --danger: #D4584B; --danger-bg: #FCE4DF;
  --ok: #1C9B5E; --ok-bg: #E2F4EA;

  --bg: #F6F1E7; --bg-2: #EFE7D7; --card: #FFFFFF;
  --ink: #1C2620; --ink-2: #5C6B62; --ink-3: #91A096;
  --line: #E4DBCB; --line-2: #EFEAE0;

  --shadow-sm: 0 1px 2px rgba(20,40,28,.06), 0 2px 8px rgba(20,40,28,.05);
  --shadow-md: 0 6px 18px rgba(20,40,28,.08), 0 2px 6px rgba(20,40,28,.05);
  --shadow-lg: 0 18px 44px rgba(7,67,42,.16), 0 6px 14px rgba(7,67,42,.10);
  --shadow-brand: 0 14px 30px rgba(15,98,63,.30);

  --r-sm: 12px; --r-md: 16px; --r-lg: 24px; --r-xl: 32px;
  --font: 'Be Vietnam Pro', system-ui, sans-serif;
  --display: 'Baloo 2', system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg: #0E1512; --bg-2: #121C17; --card: #18211C;
  --ink: #ECF3ED; --ink-2: #9DB0A4; --ink-3: #6F8278;
  --line: #2A352E; --line-2: #1F2A24;
  --brand-soft: color-mix(in srgb, var(--brand) 26%, var(--card));
  --brand-ink: color-mix(in srgb, var(--brand) 42%, #fff);
  --danger-bg: #2E1712; --ok-bg: #10271B;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 6px 18px rgba(0,0,0,.35);
  --shadow-lg: 0 18px 44px rgba(0,0,0,.5);
  --shadow-brand: 0 14px 30px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--brand) 12%, var(--bg)) 0%, transparent 50%),
    radial-gradient(100% 70% at 0% 100%, color-mix(in srgb, var(--peach) 12%, var(--bg)) 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
.tnum { font-variant-numeric: tabular-nums; }

.wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px 18px; }
.card { width: 100%; max-width: 440px; }

/* brand head */
.brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 22px; }
.brand-mark { width: 60px; height: 60px; border-radius: 19px; background: linear-gradient(150deg, var(--brand), var(--brand-deep)); display: grid; place-items: center; box-shadow: var(--shadow-brand); position: relative; }
.brand-mark span { font-family: var(--display); font-weight: 800; font-size: 30px; color: #fff; }
.brand-mark::after { content:""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: var(--yellow); right: 8px; bottom: 8px; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 22px; margin-top: 13px; letter-spacing: -.01em; }
.brand-sub { font-size: 13.5px; color: var(--ink-2); font-weight: 500; margin-top: 2px; }

/* panel */
.panel { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 26px 26px 24px; }

/* stepper */
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 22px; }
.sdot { display: flex; align-items: center; gap: 9px; }
.sdot .sn { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--bg-2); color: var(--ink-3); border: 1.5px solid var(--line); transition: .2s; flex: none; }
.sdot .sl { font-size: 12.5px; font-weight: 700; color: var(--ink-3); white-space: nowrap; transition: .2s; }
.sdot.on .sn { background: var(--brand); color: #fff; border-color: var(--brand); }
.sdot.on .sl { color: var(--ink); }
.sdot.done .sn { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.sline { flex: 1; height: 2px; background: var(--line); margin: 0 10px; border-radius: 2px; transition: .2s; }
.sline.done { background: var(--brand); }

.step-head { margin-bottom: 18px; }
.step-head h1 { font-family: var(--display); font-weight: 800; font-size: 22px; margin: 0; letter-spacing: -.01em; }
.step-head p { margin: 5px 0 0; color: var(--ink-2); font-size: 14px; font-weight: 500; line-height: 1.45; }

/* fields */
.fld { margin-bottom: 15px; }
.fld label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.fld label .req { color: var(--danger); margin-left: 2px; }
.fld label .opt { color: var(--ink-3); font-weight: 500; font-size: 12px; margin-left: 4px; }
.inp-wrap { position: relative; display: flex; align-items: center; }
.inp-wrap .lic { position: absolute; left: 14px; color: var(--ink-3); pointer-events: none; display: grid; }
.inp-wrap.has-prefix .pfx { position: absolute; left: 42px; font-weight: 600; color: var(--ink-2); pointer-events: none; font-size: 15px; }
.inp { width: 100%; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: var(--r-sm); padding: 13px 14px 13px 42px; font-size: 15px; font-weight: 500; transition: .15s; outline: none; }
.inp::placeholder { color: var(--ink-3); font-weight: 400; }
.inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.inp-wrap.has-prefix .inp { padding-left: 74px; }
.inp.bad { border-color: var(--danger); }
.inp.bad:focus { box-shadow: 0 0 0 3px var(--danger-bg); }
.fld .err { font-size: 12.5px; color: var(--danger); font-weight: 600; margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.fld .hint { font-size: 12.5px; color: var(--ink-3); font-weight: 500; margin-top: 6px; }
.inp-wrap .okmark { position: absolute; right: 14px; color: var(--ok); display: grid; }

/* primary button */
.btn { width: 100%; padding: 15px; border-radius: var(--r-sm); font-family: var(--display); font-weight: 700; font-size: 16px; transition: .15s; display: inline-flex; align-items: center; justify-content: center; gap: 9px; letter-spacing: -.01em; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 10px 22px rgba(15,98,63,.24); }
.btn.primary:hover { background: var(--brand-deep); transform: translateY(-1px); }
.btn.primary:active { transform: translateY(0); }
.btn.primary:disabled { background: var(--bg-2); color: var(--ink-3); box-shadow: none; cursor: default; transform: none; }
.btn.ghost { background: var(--bg-2); color: var(--ink); }
.btn.ghost:hover { filter: brightness(.97); }
.btn-row { display: flex; gap: 11px; margin-top: 4px; }
.btn-row .btn { width: auto; flex: 1; }
.btn-row .btn.back { flex: 0 0 52px; padding: 15px 0; }

.foot-note { text-align: center; font-size: 13px; color: var(--ink-2); margin-top: 18px; font-weight: 500; }
.foot-note a { color: var(--brand); font-weight: 700; }
.legal { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 16px; line-height: 1.5; font-weight: 500; }
.legal a { color: var(--ink-2); font-weight: 600; text-decoration: underline; }

/* OTP */
.otp-to { display: flex; align-items: center; gap: 10px; background: var(--brand-soft); border-radius: var(--r-md); padding: 13px 15px; margin-bottom: 20px; }
.otp-to .pic { width: 38px; height: 38px; border-radius: 11px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.otp-to .pn { font-weight: 700; font-size: 15px; color: var(--brand-ink); }
.otp-to .pl { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.otp-to .edit { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--brand); padding: 6px 10px; border-radius: 999px; }
.otp-to .edit:hover { background: color-mix(in srgb, var(--brand) 14%, transparent); }

.otp-inputs { display: flex; gap: 9px; justify-content: center; margin: 8px 0 4px; }
.otp-box { width: 100%; max-width: 54px; aspect-ratio: 1 / 1.15; border: 1.5px solid var(--line); background: var(--card); border-radius: var(--r-sm); text-align: center; font-family: var(--display); font-weight: 800; font-size: 26px; color: var(--ink); outline: none; transition: .15s; }
.otp-box:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.otp-box.filled { border-color: var(--brand); background: var(--brand-soft); }
.otp-box.bad { border-color: var(--danger); animation: shake .35s; }
@keyframes shake { 0%,100%{transform:translateX(0);} 25%{transform:translateX(-5px);} 75%{transform:translateX(5px);} }

.otp-meta { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 20px; }
.otp-timer { font-size: 13.5px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.otp-timer .tval { font-family: var(--display); font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; font-size: 15px; }
.otp-timer.expired .tval { color: var(--danger); }
.otp-resend { font-size: 13.5px; font-weight: 700; color: var(--brand); }
.otp-resend:disabled { color: var(--ink-3); cursor: default; }
.otp-err { background: var(--danger-bg); color: var(--danger); border-radius: var(--r-sm); padding: 11px 14px; font-size: 13px; font-weight: 600; display: flex; gap: 9px; align-items: center; margin-bottom: 16px; }

/* demo hint */
.demo-hint { background: var(--bg-2); border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 10px 13px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; margin-top: 14px; display: flex; gap: 8px; line-height: 1.4; }
.demo-hint b { color: var(--ink); font-family: var(--display); letter-spacing: .08em; }

/* success */
.success { text-align: center; padding: 8px 4px 4px; }
.succ-ring { width: 92px; height: 92px; border-radius: 50%; background: var(--ok-bg); display: grid; place-items: center; margin: 0 auto 20px; position: relative; animation: ring .5s cubic-bezier(.2,.9,.3,1.3); }
.succ-ring .ck { width: 56px; height: 56px; border-radius: 50%; background: var(--ok); display: grid; place-items: center; }
@keyframes ring { from { transform: scale(.5); opacity: 0; } }
.succ-ring::before, .succ-ring::after { content:""; position: absolute; border-radius: 50%; }
.success h1 { font-family: var(--display); font-weight: 800; font-size: 24px; margin: 0; letter-spacing: -.01em; }
.success p { color: var(--ink-2); font-size: 14.5px; font-weight: 500; margin: 8px 0 0; line-height: 1.5; }
.welcome-card { background: linear-gradient(150deg, var(--brand), var(--brand-deep)); color: #fff; border-radius: var(--r-lg); padding: 20px; margin: 22px 0; text-align: left; display: flex; align-items: center; gap: 15px; box-shadow: var(--shadow-brand); position: relative; overflow: hidden; }
.welcome-card::after { content:""; position:absolute; inset:0; background-image: radial-gradient(circle at 88% 30%, rgba(255,194,61,.25) 0 22px, transparent 23px), radial-gradient(circle at 12% 90%, rgba(255,255,255,.12) 0 16px, transparent 17px); }
.welcome-card .gico { width: 50px; height: 50px; border-radius: 15px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; z-index: 1; }
.welcome-card .wt { font-size: 13px; opacity: .85; font-weight: 500; z-index: 1; }
.welcome-card .wv { font-family: var(--display); font-weight: 800; font-size: 22px; z-index: 1; line-height: 1.1; margin-top: 2px; }
.autologin { font-size: 13px; color: var(--ink-3); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; }
.autologin .spin { width: 15px; height: 15px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* push notification toast (expiry reminder demo) */
.push-demo { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; width: calc(100% - 32px); max-width: 380px; }
.notif { background: color-mix(in srgb, var(--card) 96%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 18px; padding: 13px 15px; box-shadow: var(--shadow-lg); animation: ndrop .4s cubic-bezier(.2,.8,.2,1); }
@keyframes ndrop { from { transform: translateY(-20px); opacity: 0; } }
.notif-h { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.notif-app { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(150deg, var(--brand), var(--brand-deep)); display: grid; place-items: center; font-family: var(--display); font-weight: 800; color: #fff; font-size: 13px; flex: none; }
.notif-app-name { font-size: 12px; font-weight: 700; color: var(--ink); }
.notif-time { margin-left: auto; font-size: 11px; color: var(--ink-3); font-weight: 500; }
.notif-x { color: var(--ink-3); padding: 2px; }
.notif-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.notif-body { font-size: 13px; color: var(--ink-2); margin-top: 2px; line-height: 1.4; font-weight: 500; }

.toggle-demo { position: fixed; bottom: 18px; right: 18px; z-index: 60; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 9px 15px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 8px; }
.toggle-demo:hover { border-color: var(--ink-3); color: var(--ink); }

@media (max-width: 460px) {
  .sdot .sl { display: none; }
  .panel { padding: 22px 20px; }
  .otp-box { max-width: 46px; font-size: 22px; }
}
