/* =========================================================
   ExamiAi — Student Onboarding & Login
   Native Mobile App UI + Desktop Responsive Split
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0,0&display=swap');

:root {
  --brand: #2962FF;
  --brand-dark: #1E4ED8;
  --brand-light: #EEF2FF;
  --brand-glow: rgba(41, 98, 255, 0.15);
  --ink: #0F172A;
  --muted: #64748B;
  --subtle: #94A3B8;
  --surface: #FFFFFF;
  --canvas: #F8FAFC;
  --line: #E2E8F0;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  color-scheme: light only;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 450, 'GRAD' 0, 'opsz' 24;
  font-size: 22px;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
  user-select: none;
}

/* Base shell */
.shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

/* ——— Left Visual Panel (Desktop Only) ——— */
.visual {
  display: none;
  color: #fff;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #070B14 0%, #0F1B3D 45%, #1D3D8F 80%, #2962FF 100%);
}

.visual::before,
.visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.visual::before {
  width: 480px; height: 480px;
  right: -140px; top: -160px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.18), transparent 70%);
}
.visual::after {
  width: 320px; height: 320px;
  left: -80px; bottom: -100px;
  background: radial-gradient(circle, rgba(41, 98, 255, 0.25), transparent 70%);
}

.visual-art {
  position: absolute;
  right: -4%;
  bottom: 6%;
  width: min(320px, 48%);
  opacity: .28;
  pointer-events: none;
  z-index: 0;
  filter: saturate(1.1);
}

.visual-card {
  position: relative;
  z-index: 1;
  max-width: 440px;
}

.visual-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 14px;
  background: radial-gradient(120% 140% at 12% 0%, rgba(96, 165, 250, 0.22), transparent 52%), linear-gradient(160deg, #0B1220 0%, #111827 55%, #0F172A 100%);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  margin-bottom: 32px;
}

.visual-logo {
  display: block;
  width: 160px;
  height: auto;
  object-fit: contain;
}

.visual-brand-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
}

.visual h1 {
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0 0 14px;
  color: #fff;
}

.visual-lead {
  font-size: 16px;
  line-height: 1.6;
  font-weight: 500;
  max-width: 34ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.student-benefits {
  display: grid;
  gap: 16px;
  margin-top: 40px;
}

.app-highlight {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.app-highlight .material-symbols-rounded {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  color: #fff;
}
.app-highlight strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.app-highlight span {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
}

/* ——— Right Auth Area (Mobile-First Edge-to-Edge) ——— */
.auth-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--surface);
  position: relative;
}

.native-login-wrapper {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(16px, var(--sat)) max(20px, var(--sal)) max(24px, var(--sab)) max(20px, var(--sar));
  box-sizing: border-box;
}

/* ——— Native App Bar ——— */
.native-app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  margin-bottom: 12px;
  position: relative;
}

.native-bar-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #F1F5F9;
  color: var(--ink);
  border: none;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  transition: transform .15s ease, background .15s ease;
}
.native-bar-btn:active {
  transform: scale(0.92);
  background: #E2E8F0;
}
.native-bar-btn .material-symbols-rounded {
  font-size: 20px;
}

.native-bar-form {
  margin: 0;
  padding: 0;
  display: inline-flex;
}

.native-bar-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border-radius: 12px;
  background: radial-gradient(120% 140% at 12% 0%, rgba(96, 165, 250, 0.22), transparent 52%), linear-gradient(160deg, #0B1220 0%, #111827 55%, #0F172A 100%);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.native-bar-brand:active {
  transform: scale(0.97);
}
.native-bar-logo {
  height: 22px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  display: block;
}

.native-bar-help {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  background: #F8FAFC;
  border: 1px solid var(--line);
  transition: color .15s ease, background .15s ease;
}
.native-bar-help:hover {
  color: var(--brand);
  background: var(--brand-light);
}

/* ——— Slim Native Progress Track ——— */
.native-step-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 24px;
}
.native-step-track {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.native-step-seg {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: #E2E8F0;
  transition: background .3s var(--ease);
}
.native-step-seg.is-done {
  background: var(--brand);
}
.native-step-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--subtle);
  white-space: nowrap;
}

/* ——— Native Header Block ——— */
.native-auth-header {
  margin-bottom: 28px;
}

.native-app-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2962FF 0%, #1E4ED8 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 20px var(--brand-glow);
  margin-bottom: 16px;
}
.native-app-badge .material-symbols-rounded {
  font-size: 24px;
}

.native-main-title {
  font-size: clamp(22px, 5.5vw, 28px);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 0 0 8px;
  line-height: 1.2;
}

.native-sub-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}
.native-sub-title strong {
  color: var(--ink);
  font-weight: 700;
}

.native-change-email-form {
  margin-top: 10px;
}
.native-edit-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-light);
  border: 1px solid rgba(41, 98, 255, 0.16);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.native-edit-email-btn:active {
  transform: scale(0.95);
}
.native-edit-email-btn .material-symbols-rounded {
  font-size: 14px;
}

/* ——— Alerts ——— */
.native-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 20px;
  animation: alertEnter .25s var(--ease);
}
@keyframes alertEnter {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.native-alert .material-symbols-rounded {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.native-alert-error {
  background: #FEF2F2;
  border: 1px solid #FEE2E2;
  color: #DC2626;
}
.native-alert-success {
  background: #F0FDF4;
  border: 1px solid #DCFCE7;
  color: #16A34A;
}
.native-alert-info {
  background: #EFF6FF;
  border: 1px solid #DBEAFE;
  color: #1D4ED8;
}

/* ——— Forms & Native Inputs ——— */
.native-form-body {
  flex: 1;
}

.native-input-group {
  margin-bottom: 20px;
}

.native-input-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.native-optional-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--subtle);
  background: #F1F5F9;
  padding: 2px 8px;
  border-radius: 999px;
}

.native-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: var(--radius-md);
  background: #F8FAFC;
  border: 1.5px solid var(--line);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.native-input-wrap:focus-within {
  border-color: var(--brand);
  background: #FFFFFF;
  box-shadow: 0 0 0 4px var(--brand-glow);
}
.native-input-wrap.is-readonly {
  background: #F1F5F9;
  border-color: #E2E8F0;
  color: var(--muted);
}

.native-input-icon {
  position: absolute;
  left: 16px;
  font-size: 20px;
  color: #94A3B8;
  pointer-events: none;
  transition: color .18s ease;
}
.native-input-wrap:focus-within .native-input-icon {
  color: var(--brand);
}

.native-text-input {
  width: 100%;
  height: 54px;
  padding: 0 16px 0 48px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
  -webkit-appearance: none;
  border-radius: inherit;
}
.native-text-input::placeholder {
  color: #94A3B8;
  font-weight: 450;
}
.native-text-input[readonly] {
  color: #64748B;
  cursor: default;
}

.native-field-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin: 8px 0 0;
}
.native-field-hint .material-symbols-rounded {
  font-size: 15px;
  color: #94A3B8;
}

/* ——— Dedicated Large Native OTP Field ——— */
.native-otp-container {
  margin: 16px 0 8px;
}
.native-otp-field {
  width: 100%;
  height: 64px;
  border-radius: 16px;
  background: #F8FAFC;
  border: 2px solid var(--line);
  text-align: center;
  font-family: inherit;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.35em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  -webkit-appearance: none;
  padding: 0 16px;
}
.native-otp-field:focus {
  border-color: var(--brand);
  background: #FFFFFF;
  box-shadow: 0 0 0 5px var(--brand-glow);
}
.native-otp-field::placeholder {
  color: #CBD5E1;
  letter-spacing: 0.25em;
  font-weight: 400;
}

/* ——— Primary Submit Button ——— */
.native-submit-btn {
  width: 100%;
  height: 54px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(180deg, #3B72FF 0%, #2962FF 100%);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--brand-glow);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  margin-top: 12px;
  -webkit-tap-highlight-color: transparent;
}
.native-submit-btn:hover {
  background: linear-gradient(180deg, #4B7DFF 0%, #1E4ED8 100%);
  box-shadow: 0 8px 24px rgba(41, 98, 255, 0.32);
}
.native-submit-btn:active {
  transform: scale(0.985);
  box-shadow: 0 2px 10px rgba(41, 98, 255, 0.2);
}
.native-submit-btn .material-symbols-rounded {
  font-size: 20px;
  transition: transform .18s ease;
}
.native-submit-btn:hover .material-symbols-rounded {
  transform: translateX(3px);
}
.native-submit-btn[disabled] {
  opacity: 0.7;
  cursor: wait;
}

/* ——— Resend & Secondary Actions ——— */
.native-resend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
}
.native-resend-form {
  margin: 0;
  padding: 0;
}
.native-resend-btn {
  background: none;
  border: none;
  color: var(--brand);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background .15s ease, transform .15s ease;
}
.native-resend-btn:hover {
  background: var(--brand-light);
}
.native-resend-btn:active {
  transform: scale(0.96);
}
.native-resend-btn .material-symbols-rounded {
  font-size: 18px;
}
.native-resend-btn.is-disabled {
  color: var(--subtle);
  pointer-events: none;
  cursor: default;
}

/* ——— Native Auth Footer ——— */
.native-auth-footer {
  margin-top: auto;
  padding-top: 28px;
  text-align: center;
}

.native-secure-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background: #F8FAFC;
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.native-secure-badge .material-symbols-rounded {
  font-size: 16px;
  color: #16A34A;
}

.native-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--subtle);
  margin-bottom: 8px;
}
.native-footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  transition: color .15s ease;
}
.native-footer-links a:hover {
  color: var(--brand);
}

.native-copyright {
  font-size: 11px;
  color: #94A3B8;
  font-weight: 500;
}

/* Animations */
.fade-up {
  animation: nativeEnter 0.35s var(--ease) both;
}
@keyframes nativeEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ——— Desktop Adaptation (≥ 960px) ——— */
@media (min-width: 960px) {
  .shell {
    display: grid;
    grid-template-columns: minmax(440px, 1.15fr) minmax(480px, 0.85fr);
    background: #F1F4F9;
  }

  .visual {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 64px 56px;
  }

  .auth-area {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: transparent;
  }

  .native-login-wrapper {
    min-height: auto;
    max-width: 440px;
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.04), 0 24px 50px -12px rgba(15, 23, 42, 0.08);
    padding: 36px 32px 32px;
  }

  .native-app-bar {
    margin-bottom: 20px;
  }
}
