/* ═══════════════════════════════════════════════════════
   AchieveX — Shared Auth Pages CSS (Apple style)
   Used by: signup, login, forgot-password
═══════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg:       #F5F5F7;
  --surface:  #FFFFFF;
  --surface2: #F5F5F7;
  --border:   rgba(0,0,0,.08);
  --border-m: rgba(0,0,0,.13);
  --txt:      #1D1D1F;
  --txt2:     #3D3D3F;
  --txt3:     #6E6E73;
  --txt4:     #AEAEB2;
  --blue:     #0071E3;
  --blue-d:   #0051A8;
  --blue-l:   rgba(0,113,227,.1);
  --green:    #34C759;
  --red:      #FF3B30;
  --orange:   #FF9500;
  --r:        12px;
  --r-lg:     18px;
  --r-xl:     22px;
  --ease:     cubic-bezier(.25,.46,.45,.94);
  --spring:   cubic-bezier(.34,1.56,.64,1);
  --font:     'DM Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-d:   'Sora', sans-serif;
}
html.dark {
  --bg:       #000;
  --surface:  #1C1C1E;
  --surface2: #2C2C2E;
  --border:   rgba(255,255,255,.1);
  --border-m: rgba(255,255,255,.18);
  --txt:      #F5F5F7;
  --txt2:     #EBEBF0;
  --txt3:     #8E8E93;
  --txt4:     #48484A;
  --blue-l:   rgba(0,113,227,.18);
}
html {
  width: 100%; min-height: 100%;
  font-family: var(--font);
  background: var(--bg); color: var(--txt);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
body {
  width: 100%; min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input { font-family: inherit; color: inherit; }
a { text-decoration: none; color: var(--blue); }

/* PAGE */
.page {
  min-height: 100vh;
  min-height: -webkit-fill-available;
  padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 24px 16px 48px;
}

/* TOPBAR */
.topbar {
  width: 100%; max-width: 400px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-shrink: 0;
}
.logo { display: flex; align-items: center; gap: 8px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(145deg, #0A84FF, #0051A8);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 2px 8px rgba(0,113,227,.35); flex-shrink: 0;
}
.logo-mark svg { width: 15px; height: 15px; }
.logo-name { font-family: var(--font-d); font-size: 15px; font-weight: 700; letter-spacing: -.03em; }
.btn-back {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--txt3);
  transition: all .15s; box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.btn-back:hover { background: var(--surface2); color: var(--txt); }
.btn-back svg { width: 14px; height: 14px; }

/* STEP DOTS */
.steps { display: flex; align-items: center; gap: 6px; margin-bottom: 20px; }
.s-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-m); transition: all .3s var(--spring); }
.s-dot.active { width: 20px; border-radius: 3px; background: var(--blue); }
.s-dot.done { background: var(--green); }

/* CARD */
.card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: 0 4px 6px rgba(0,0,0,.04), 0 12px 32px rgba(0,0,0,.07), 0 40px 80px rgba(0,0,0,.04);
  overflow: hidden;
  animation: cardIn .38s var(--ease) both;
}
html.dark .card { box-shadow: 0 12px 40px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.3); }
@keyframes cardIn { from { opacity:0; transform:translateY(12px) scale(.98); } to { opacity:1; transform:none; } }

.card-body { padding: 26px 22px 22px; overflow-y: visible; }

/* SCREEN */
.screen { display: none; }
.screen.active { display: block; animation: fadeUp .28s var(--ease) both; }
@keyframes fadeUp { from { opacity:0; transform:translateY(7px); } to { opacity:1; transform:none; } }

/* HEADER */
.card-head { margin-bottom: 18px; }
.card-title { font-family: var(--font-d); font-size: 21px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; margin-bottom: 5px; }
.card-sub { font-size: 13.5px; color: var(--txt3); line-height: 1.5; }

/* AUTH BUTTONS ROW */
.auth-btns { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.auth-btn {
  width: 100%; height: 42px;
  border-radius: var(--r); border: 1px solid var(--border-m);
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 14px; font-weight: 500; color: var(--txt);
  transition: all .15s var(--ease);
}
.auth-btn:hover { background: var(--surface); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.auth-btn:active { transform: none; }
.auth-btn svg, .auth-btn img { width: 18px; height: 18px; flex-shrink: 0; }
.auth-btn .phone-icon {
  width: 18px; height: 18px; border-radius: 4px;
  background: linear-gradient(135deg, #34C759, #248A3D);
  display: grid; place-items: center; color: #fff; flex-shrink: 0;
}
.auth-btn .phone-icon svg { width: 11px; height: 11px; }

/* DIVIDER */
.divider {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--txt4); font-weight: 500; letter-spacing: .02em;
  margin-bottom: 16px;
}
.divider::before, .divider::after { content:''; flex:1; height:1px; background:var(--border); }

/* ERROR / SUCCESS BANNER */
.err-banner {
  display: flex; align-items: flex-start; gap: 7px;
  background: rgba(255,59,48,.08); border: 1px solid rgba(255,59,48,.2);
  border-radius: var(--r); padding: 10px 12px;
  font-size: 13px; color: var(--red); margin-bottom: 14px; line-height: 1.4;
}
.err-banner svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }
.err-banner.hidden { display: none !important; }
.ok-banner {
  display: flex; align-items: flex-start; gap: 7px;
  background: rgba(52,199,89,.08); border: 1px solid rgba(52,199,89,.2);
  border-radius: var(--r); padding: 10px 12px;
  font-size: 13px; color: var(--green); margin-bottom: 14px; line-height: 1.4;
}
.ok-banner svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }
.ok-banner.hidden { display: none !important; }

/* FORM */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fg { margin-bottom: 12px; }
.lbl { display: block; font-size: 11.5px; font-weight: 600; color: var(--txt3); margin-bottom: 5px; letter-spacing: .02em; text-transform: uppercase; }
.opt { font-weight: 400; opacity: .7; }
.iw { position: relative; }
.inp {
  width: 100%; height: 40px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 0 12px;
  font-size: 14.5px; color: var(--txt);
  outline: none; transition: all .15s; -webkit-appearance: none;
}
.inp.has-icon { padding-right: 38px; }
.inp:focus { border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 3px var(--blue-l); }
.inp.bad { border-color: var(--red); }
.inp.bad:focus { box-shadow: 0 0 0 3px rgba(255,59,48,.12); }

/* Phone input with country code */
.phone-row { display: flex; gap: 8px; }
.country-sel {
  width: 80px; height: 40px; flex-shrink: 0;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 0 8px;
  font-size: 14px; color: var(--txt); outline: none;
  -webkit-appearance: none; appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%236E6E73' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 12px;
  padding-right: 22px;
  transition: all .15s;
}
.country-sel:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-l); }

/* OTP input */
.otp-row { display: flex; gap: 8px; justify-content: center; margin: 8px 0 4px; }
.otp-inp {
  width: 44px; height: 50px;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: var(--r); text-align: center;
  font-size: 20px; font-weight: 700; font-family: var(--font-d);
  color: var(--txt); outline: none; transition: all .15s;
  -webkit-appearance: none;
}
.otp-inp:focus { border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 3px var(--blue-l); }
.otp-inp.filled { border-color: var(--blue); }

.icon-r {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center; color: var(--txt4);
}
.icon-r svg { width: 15px; height: 15px; }
.eye-btn {
  position: absolute; right: 0; top: 0; bottom: 0; width: 38px;
  display: grid; place-items: center; color: var(--txt4);
  transition: color .15s; border-radius: 0 var(--r) var(--r) 0;
}
.eye-btn:hover { color: var(--txt2); }
.eye-btn svg { width: 15px; height: 15px; }

.hint { font-size: 11.5px; margin-top: 4px; color: var(--txt4); }
.hint.ok { color: var(--green); }
.hint.bad { color: var(--red); }

/* STRENGTH */
.strength-wrap { margin-top: 7px; display: none; }
.s-bars { display: flex; gap: 3px; margin-bottom: 3px; }
.s-bar { flex: 1; height: 3px; border-radius: 2px; background: var(--border-m); transition: all .2s; }
.s-lbl { font-size: 11px; color: var(--txt4); }

/* TERMS */
.terms { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 16px; cursor: pointer; }
.chk {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--border-m); background: var(--surface2);
  display: grid; place-items: center; flex-shrink: 0; margin-top: 1px;
  transition: all .15s var(--spring);
}
.chk.on { background: var(--blue); border-color: var(--blue); box-shadow: 0 2px 6px rgba(0,113,227,.35); }
.chk svg { width: 10px; height: 10px; color: #fff; opacity: 0; transition: opacity .1s; }
.chk.on svg { opacity: 1; }
.terms-txt { font-size: 12.5px; color: var(--txt3); line-height: 1.5; }
.terms-txt a { color: var(--blue); font-weight: 500; }

/* REMEMBER + FORGOT ROW */
.rf-row { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 14px; }
.remember { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.rem-chk {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid var(--border-m); background: var(--surface2);
  display: grid; place-items: center; flex-shrink: 0;
  transition: all .15s var(--spring);
}
.rem-chk.on { background: var(--blue); border-color: var(--blue); }
.rem-chk svg { width: 9px; height: 9px; color: #fff; opacity: 0; transition: opacity .1s; }
.rem-chk.on svg { opacity: 1; }
.rem-lbl { font-size: 13px; color: var(--txt3); }
.forgot-link { font-size: 13px; color: var(--blue); font-weight: 500; }

/* BUTTONS */
.btn-primary {
  width: 100%; height: 44px;
  background: var(--blue); border-radius: var(--r);
  color: #fff; font-size: 15px; font-weight: 600; letter-spacing: -.01em;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: all .15s; position: relative; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,113,227,.3);
}
.btn-primary::after { content:''; position:absolute; inset:0; background:linear-gradient(180deg,rgba(255,255,255,.1),transparent); pointer-events:none; }
.btn-primary:hover { background: #0077ED; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,113,227,.4); }
.btn-primary:active { transform: none; }
.btn-primary:disabled { opacity: .55; pointer-events: none; }
.btn-primary svg { width: 14px; height: 14px; }
.btn-ghost {
  width: 100%; height: 40px; border-radius: var(--r);
  border: 1px solid var(--border-m); color: var(--txt2);
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .15s; margin-top: 8px;
}
.btn-ghost:hover { background: var(--surface2); border-color: var(--border-m); }

/* CARD FOOTER */
.card-foot {
  padding: 13px 22px; border-top: 1px solid var(--border);
  text-align: center; font-size: 13px; color: var(--txt3);
  background: var(--surface2);
}
.card-foot a { color: var(--blue); font-weight: 600; }

/* VERIFY SCREEN */
.verify-wrap { text-align: center; padding: 6px 0 2px; }
.verify-icon {
  width: 58px; height: 58px; border-radius: 16px;
  background: var(--blue-l); display: grid; place-items: center;
  margin: 0 auto 16px; color: var(--blue);
  box-shadow: 0 4px 14px rgba(0,113,227,.15);
}
.verify-icon svg { width: 24px; height: 24px; }
.email-badge {
  display: inline-block; background: var(--blue-l); color: var(--blue);
  border-radius: 6px; padding: 2px 10px; font-size: 13px; font-weight: 600;
  margin: 6px 0 16px; word-break: break-all;
}

/* PHONE OTP SCREEN */
.otp-wrap { text-align: center; padding: 6px 0 2px; }
.otp-icon {
  width: 58px; height: 58px; border-radius: 16px;
  background: rgba(52,199,89,.1); display: grid; place-items: center;
  margin: 0 auto 16px; color: var(--green);
}
.otp-icon svg { width: 24px; height: 24px; }
.phone-badge {
  display: inline-block; background: rgba(52,199,89,.1); color: var(--green);
  border-radius: 6px; padding: 2px 10px; font-size: 13px; font-weight: 600;
  margin: 6px 0 16px;
}
.otp-timer { font-size: 12.5px; color: var(--txt4); margin-top: 8px; }
.otp-timer span { color: var(--blue); font-weight: 600; }

/* ONBOARD */
.section-lbl {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--txt4); margin: 16px 0 9px;
}
.section-lbl:first-child { margin-top: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
  height: 31px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border-m); background: var(--surface2);
  font-size: 13px; font-weight: 500; color: var(--txt2);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.pill:hover { border-color: var(--blue); color: var(--blue); }
.pill.on { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 2px 6px rgba(0,113,227,.3); }

.hrs-wrap { display: flex; align-items: center; gap: 12px; }
.hrs-val { font-size: 20px; font-weight: 700; font-family: var(--font-d); color: var(--blue); min-width: 48px; letter-spacing: -.03em; }
.hrs-unit { font-size: 12px; color: var(--txt4); }
input[type=range] { flex:1; height:4px; border-radius:2px; -webkit-appearance:none; appearance:none; background:var(--border-m); outline:none; cursor:pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance:none; width:18px; height:18px; border-radius:50%; background:var(--blue); box-shadow:0 1px 4px rgba(0,113,227,.4); transition:transform .15s var(--spring); }
input[type=range]::-webkit-slider-thumb:hover { transform:scale(1.15); }

/* SUCCESS SCREEN */
.done-wrap { text-align: center; padding: 10px 0 6px; }
.success-ring {
  width: 62px; height: 62px; border-radius: 50%;
  background: rgba(52,199,89,.12); display: grid; place-items: center;
  margin: 0 auto 16px; color: var(--green);
  animation: popIn .4s var(--spring) .1s both;
}
.success-ring svg { width: 26px; height: 26px; }
@keyframes popIn { from { transform:scale(.6); opacity:0; } to { transform:scale(1); opacity:1; } }
.progress-track { height: 3px; background: var(--border); border-radius: 2px; margin-top: 20px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 2px; animation: prog 2.5s linear forwards; }
@keyframes prog { from { width:0; } to { width:100%; } }

/* FORGOT — lock icon header */
.lock-icon {
  width: 58px; height: 58px; border-radius: 16px;
  background: rgba(0,113,227,.1); display: grid; place-items: center;
  margin: 0 auto 18px; color: var(--blue);
}
.lock-icon svg { width: 24px; height: 24px; }

/* RECAPTCHA */
#recaptcha-container { margin: 10px 0; }

/* TOAST */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--txt); color: var(--bg);
  padding: 10px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  z-index: 999; white-space: nowrap;
  transition: transform .3s var(--spring), opacity .3s; opacity: 0;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
