    :root {
      /* Dynamic Accent Variables */
      --accent: #2563eb;
      --accent-dark: #1d4ed8;
      --accent-wash: #eff6ff;
      --accent-border: #bfdbfe;
      --accent-glow: rgba(37, 99, 235, 0.32);
      
      --purple: #7c3aed;
      --purple-dark: #6d28d9;
      --purple-wash: #f5f3ff;
      --purple-border: #ddd6fe;
      --accent-pink: #ec4899;
      --accent-green: #10b981;
      --accent-yellow: #f59e0b;
      
      --ink: #0b1220;
      --ink-soft: #101a33;
      --border: #e2e8f0;
      --border-light: #edf2f7;
      --border-focus: #94a3b8;
      --text-main: #0f172a;
      --text-muted: #64748b;
      --text-subtle: #64748b;
      
      --radius-sm: 8px;
      --radius-md: 12px;
      --radius-lg: 20px;
      --radius-full: 9999px;
      --shadow-dropdown: 0 16px 34px rgba(15, 23, 42, 0.14);
      --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }

    *, *::before, *::after { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color: transparent; }
    
    body {
      font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
      background: #f8fafc; color: var(--text-main); min-height: 100vh;
      -webkit-font-smoothing: antialiased; overflow-x: hidden;
    }
    a { text-decoration: none; color: inherit; }
    button { font-family: inherit; cursor: pointer; border: none; background: none; outline: none; }

    .auth-shell { width: 100%; min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; }

    /* ================= LEFT BRAND PANEL ================= */
    .brand-panel {
      background:
        radial-gradient(800px 550px at 12% 0%, var(--accent-glow), transparent 65%),
        linear-gradient(180deg, var(--ink) 0%, var(--ink-soft) 100%);
      color: #fff; padding: 52px 46px; display: flex; flex-direction: column;
      justify-content: space-between; position: relative; overflow: hidden;
      transition: background 0.35s ease;
    }
    .brand-panel::after {
      content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.4;
      background-image: radial-gradient(rgba(255,255,255,0.1) 1px, transparent 1px);
      background-size: 24px 24px;
      mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
    }

    /* Logo styles live in brand.css (single source of truth); the panel passes logoDark so it turns light on navy. */
    .brand-panel .app-brand-lockup { position: relative; z-index: 1; }

    .hero-container { z-index: 1; margin: 36px 0; }
    .portal-badge {
      display: inline-flex; align-items: center; gap: 8px; font-size: 0.76rem; font-weight: 700;
      color: #fff; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.22);
      padding: 6px 15px; border-radius: var(--radius-full); backdrop-filter: blur(8px);
      margin-bottom: 20px; transition: var(--transition);
    }

    .hero-block h2 { font-size: 2.15rem; font-weight: 800; line-height: 1.25; margin-bottom: 14px; letter-spacing: -0.025em; }
    .hero-block p { color: #94a3b8; font-size: 0.96rem; line-height: 1.6; margin-bottom: 26px; }

    /* Left Benefit Points */
    .benefit-list { display: flex; flex-direction: column; gap: 16px; }
    .benefit-item { display: flex; align-items: flex-start; gap: 14px; }
    .benefit-icon {
      width: 34px; height: 34px; border-radius: 8px;
      background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.15);
      display: flex; align-items: center; justify-content: center; font-size: 1.05rem; color: #fff;
      flex-shrink: 0; margin-top: 2px;
    }
    .benefit-text strong { display: block; font-size: 0.92rem; font-weight: 700; color: #fff; margin-bottom: 2px; }
    .benefit-text span { font-size: 0.82rem; color: #94a3b8; line-height: 1.4; display: block; }

    .trust-strip { z-index: 1; border-top: 1px solid rgba(255,255,255,0.12); padding-top: 20px; }
    .fine-print { font-size: 0.75rem; color: #64748b; }

    /* ================= RIGHT FORM PANEL ================= */
    .form-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
    .form-card {
      width: 100%; max-width: 410px;
      transition: opacity 0.2s ease, transform 0.2s ease;
    }
    .form-card.switching { opacity: 0; transform: translateY(6px); }

    .top-nav-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
    .back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.84rem; font-weight: 700; color: var(--text-muted); transition: var(--transition); }
    .back-link:hover { color: var(--accent); }

    .form-card h1 { font-size: 1.58rem; font-weight: 800; letter-spacing: -0.025em; margin-bottom: 6px; }
    .form-card p.sub { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 22px; line-height: 1.5; }

    /* Social Auth Buttons Grid */
    .social-auth-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-bottom: 6px;
    }

    .btn-social {
      width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px;
      background: #fff; border: 1.5px solid var(--border); padding: 12px;
      border-radius: var(--radius-md); font-weight: 700; font-size: 0.90rem; color: var(--text-main);
      transition: var(--transition);
    }
    .btn-social:hover { border-color: var(--border-focus); background: #f8fafc;  }
    .btn-social.google i { font-size: 1.22rem; color: #ea4335; }
    .btn-social.facebook i { font-size: 1.22rem; color: #1877f2; }

    .divider { display: flex; align-items: center; gap: 14px; color: var(--text-subtle); font-size: 0.76rem; font-weight: 700; margin: 18px 0; text-transform: uppercase; letter-spacing: 0.04em; }
    .divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

    .input-label { display: block; font-size: 0.86rem; font-weight: 700; margin-bottom: 8px; color: var(--text-main); }
    .input-box {
      width: 100%; min-height: 48px; padding: 12px 16px; border: 1.5px solid var(--border);
      border-radius: var(--radius-md); font-size: 1rem;
      font-family: inherit; outline: none; transition: var(--transition); margin-bottom: 16px; color: var(--text-main);
    }
    .input-box:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
    .input-box:focus-visible { outline: none; }

    /* RESPONSIVE 6-DIGIT OTP GRID */
    .otp-grid { display: flex; gap: 8px; justify-content: space-between; margin-bottom: 20px; }
    .otp-digit {
      flex: 1; max-width: 48px; height: 54px; text-align: center; font-size: 1.45rem; font-weight: 800;
      border: 1.5px solid var(--border); border-radius: var(--radius-md);
      color: var(--text-main); outline: none; transition: var(--transition);
    }
    .otp-digit:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
    .otp-digit:focus-visible { outline: none; }

    .btn-primary-auth {
      width: 100%; min-height: 48px; background: var(--accent); color: #fff; padding: 13px;
      border-radius: var(--radius-md); font-weight: 700; font-size: 0.95rem; transition: var(--transition);
      box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 8px 18px -6px var(--accent);
      display: flex; align-items: center; justify-content: center; gap: 8px;
    }
    .btn-primary-auth:hover { background: var(--accent-dark);  }
    .btn-primary-auth:disabled { opacity: 0.85; cursor: not-allowed; transform: none; }

    /* Loading state — a smooth, thin rotating ring instead of a chunky
       spinning icon glyph. Sits inline with the button label via the
       flex layout above. */
    .btn-spinner {
      display: inline-block; width: 16px; height: 16px; flex-shrink: 0;
      border: 2px solid rgba(255, 255, 255, 0.35);
      border-top-color: #fff;
      border-radius: 50%;
      animation: btn-spin 0.65s linear infinite;
    }
    @keyframes btn-spin {
      to { transform: rotate(360deg); }
    }
    @media (prefers-reduced-motion: reduce) {
      .btn-spinner { animation-duration: 1.4s; }
    }

    .alert-banner { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.84rem; line-height: 1.45; margin-bottom: 18px; display: none; }
    .alert-banner.error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; display: block; }
    .alert-banner.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; display: block; }
    .alert-email-link { color: #7f1d1d; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
    .alert-email-link:hover { color: #450a0a; }
    .alert-banner.success .alert-email-link { color: #14532d; }
    .alert-banner.success .alert-email-link:hover { color: #052e16; }

    .resend-box { margin-top: 14px; text-align: center; font-size: 0.84rem; color: var(--text-muted); }
    .resend-link { font-weight: 700; color: var(--accent); cursor: pointer; }
    .resend-link.disabled { color: var(--text-subtle); cursor: not-allowed; }

    #otpSection { display: none; }

    /* Contextual Switch Footer */
    .switch-cta-box {
      margin-top: 24px; padding: 14px 16px; background: #f8fafc; border: 1px dashed var(--border);
      border-radius: var(--radius-md); text-align: center; font-size: 0.85rem; color: var(--text-muted);
    }
    .switch-link {
      font-weight: 800; color: var(--accent); cursor: pointer; margin-left: 4px;
      display: inline-flex; align-items: center; gap: 4px; transition: var(--transition);
    }
    .switch-link:hover { text-decoration: underline; }

    .mobile-logo { display: none; margin-bottom: 20px; }

    @media (max-width: 900px) {
      .auth-shell { grid-template-columns: 1fr; }
      .brand-panel { display: none; }
      .form-panel { padding: 32px 18px; }
      .mobile-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; }
    }


    /* ============================================================
       SIGNUP / LOGIN POLISH — portal colours, fields, motion
       ============================================================ */
    body.portal-trainer {
      --accent: #7c3aed; --accent-dark: #6d28d9; --accent-wash: #f5f3ff;
      --accent-border: #ddd6fe; --accent-glow: rgba(124, 58, 237, 0.35);
    }
    :root { --danger: #dc2626; --danger-wash: #fef2f2; --ok: #16a34a; --ease: cubic-bezier(0.16, 1, 0.3, 1); }

    @keyframes stepIn   { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
    @keyframes fadeUp   { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
    @keyframes shake    { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
    @keyframes popIn    { 0% { opacity: 0; transform: scale(.85); } 60% { transform: scale(1.04); } 100% { opacity: 1; transform: none; } }
    @keyframes ringPulse{ 0% { transform: scale(.8); opacity: .55; } 100% { transform: scale(1.7); opacity: 0; } }
    @keyframes floaty   { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
    @keyframes drawCheck{ from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }

    .form-card { max-width: 420px; }
    .form-panel { align-items: flex-start; padding-top: clamp(24px, 6vh, 64px); }
    @media (min-height: 760px) and (min-width: 901px) { .form-panel { align-items: center; padding-top: 40px; } }

    .step { display: none; }
    .step.is-active { display: block; animation: stepIn .45s var(--ease) both; }
    .step[hidden] { display: none !important; }
    .center { text-align: center; }

    /* staggered entrance for the first screen */
    .step.is-active > h1, .step.is-active > .sub { animation: fadeUp .5s var(--ease) both; }
    .step.is-active > .sub { animation-delay: .05s; }
    .step.is-active form .field { animation: fadeUp .5s var(--ease) both; }
    .step.is-active form .field:nth-of-type(1) { animation-delay: .08s; }
    .step.is-active form .field:nth-of-type(2) { animation-delay: .13s; }
    .step.is-active form .field:nth-of-type(3) { animation-delay: .18s; }
    .step.is-active form .field:nth-of-type(4) { animation-delay: .23s; }

    .portal-chip {
      display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 800;
      color: var(--accent); background: var(--accent-wash); border: 1px solid var(--accent-border);
      padding: 5px 12px; border-radius: var(--radius-full); letter-spacing: .02em;
    }

    /* ---------- fields ---------- */
    .field { margin-bottom: 16px; position: relative; }
    .field .input-box { margin-bottom: 0; }
    .label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
    .label-row .input-label { margin-bottom: 0; }
    .mini-link { font-size: .8rem; font-weight: 700; color: var(--accent); transition: var(--transition); }
    .mini-link:hover { text-decoration: underline; }

    .input-box { background: #fff; }
    .input-box:hover { border-color: var(--border-focus); }
    .input-box::placeholder { color: var(--text-subtle); }
    .field.has-error .input-box { border-color: var(--danger); background: var(--danger-wash); }
    .field.has-error .input-box:focus { box-shadow: 0 0 0 4px rgba(220,38,38,.12); }
    .field.has-error .input-box, .field.has-error .check-box { animation: shake .4s ease; }
    .field.is-valid .input-box { border-color: #86efac; }

    .field-error { display: none; margin-top: 6px; font-size: .78rem; font-weight: 600; color: var(--danger); line-height: 1.4; }
    .field.has-error .field-error { display: block; animation: fadeUp .25s var(--ease) both; }
    .field-hint { margin-top: 6px; font-size: .78rem; color: var(--text-muted); }
    .field-hint button { color: var(--accent); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }

    .hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

    /* password show/hide */
    .pw-wrap { position: relative; }
    .pw-wrap .input-box { padding-right: 48px; }
    .pw-toggle {
      position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
      width: 38px; height: 38px; border-radius: 10px; color: var(--text-muted); font-size: 1.15rem;
      display: inline-flex; align-items: center; justify-content: center; transition: var(--transition);
    }
    .pw-toggle:hover { color: var(--accent); background: var(--accent-wash); }
    .pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

    /* strength meter */
    .strength { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
    .strength-bars { display: flex; gap: 4px; flex: 0 0 96px; }
    .strength-bars i { flex: 1; height: 5px; border-radius: 4px; background: var(--border); transition: background .3s ease, transform .3s var(--ease); transform-origin: left; }
    .strength[data-level="1"] .strength-bars i:nth-child(-n+1) { background: #ef4444; }
    .strength[data-level="2"] .strength-bars i:nth-child(-n+2) { background: #f59e0b; }
    .strength[data-level="3"] .strength-bars i:nth-child(-n+3) { background: #22c55e; }
    .strength[data-level="4"] .strength-bars i:nth-child(-n+4) { background: #16a34a; }
    .strength-label { font-size: .76rem; font-weight: 700; color: var(--text-muted); transition: color .25s ease; }
    .strength[data-level="1"] .strength-label { color: #dc2626; }
    .strength[data-level="2"] .strength-label { color: #d97706; }
    .strength[data-level="3"] .strength-label, .strength[data-level="4"] .strength-label { color: #15803d; }

    .pw-rules { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; }
    .pw-rules li { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600; color: var(--text-subtle); transition: color .25s ease; }
    .pw-rules li i { font-size: .8rem; transition: transform .3s var(--ease), color .25s ease; }
    .pw-rules li.ok { color: #15803d; }
    .pw-rules li.ok i { color: var(--ok); transform: scale(1.15); }

    /* custom checkbox */
    .check-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .84rem; color: var(--text-muted); line-height: 1.45; }
    .check-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
    .check-box {
      flex: 0 0 20px; width: 20px; height: 20px; margin-top: 1px; border: 1.5px solid var(--border-focus); border-radius: 6px; background: #fff;
      display: inline-flex; align-items: center; justify-content: center; color: transparent; font-size: .9rem; transition: var(--transition);
    }
    .check-row:hover .check-box { border-color: var(--accent); }
    .check-row input:checked + .check-box { background: var(--accent); border-color: var(--accent); color: #fff; animation: popIn .3s var(--ease); }
    .check-row input:focus-visible + .check-box { box-shadow: 0 0 0 4px var(--accent-wash); border-color: var(--accent); }
    .check-text a { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
    .field.has-error .check-box { border-color: var(--danger); }

    /* ---------- buttons ---------- */
    .btn-primary-auth { cursor: pointer; text-align: center; }
    .btn-primary-auth i { transition: transform .25s var(--ease); }
    .btn-primary-auth:hover i { transform: translateX(3px); }
    .btn-primary-auth:active { transform: scale(.98); }
    .btn-primary-auth:focus-visible, .btn-social:focus-visible { outline: 3px solid var(--accent-border); outline-offset: 2px; }
    .btn-primary-auth.is-loading i { display: none; }
    .btn-primary-auth.is-success { background: var(--ok); box-shadow: 0 8px 18px -6px var(--ok); }
    a.btn-primary-auth { text-decoration: none; }

    .secure-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; font-size: .76rem; color: var(--text-muted); text-align: center; line-height: 1.4; }
    .secure-note i { color: var(--ok); font-size: .95rem; flex-shrink: 0; }

    /* ---------- login method tabs ---------- */
    .method-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: #f1f5f9; border-radius: var(--radius-md); margin-bottom: 20px; }
    .method-tabs button { position: relative; z-index: 1; min-height: 42px; border-radius: 9px; font-size: .86rem; font-weight: 700; color: #475569; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: color .25s ease; }
    .method-tabs button.is-active { color: var(--accent); }
    .method-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
    .tab-indicator { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); background: #fff; border-radius: 9px; box-shadow: 0 1px 3px rgba(15,23,42,.12); transition: transform .35s var(--ease); }
    .method-tabs[data-active="code"] .tab-indicator { transform: translateX(100%); }
    .method-pane { display: none; }
    .method-pane.is-active { display: block; animation: stepIn .35s var(--ease) both; }
    .method-pane[hidden] { display: none !important; }
    .otp-title { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
    #otpSection .sub { font-size: .88rem; color: var(--text-muted); margin-bottom: 18px; line-height: 1.5; }
    .otp-digit { background: #fff; }

    .divider { margin: 20px 0 16px; }
    .text-btn { display: block; width: 100%; text-align: center; margin-top: 16px; font-size: .84rem; font-weight: 700; color: var(--text-muted); transition: var(--transition); }
    .text-btn:hover { color: var(--accent); }
    a.text-btn.block-link { margin-top: 20px; }

    .alt-portal { margin-top: 14px; text-align: center; font-size: .82rem; color: var(--text-muted); }
    .alt-portal a { font-weight: 800; color: var(--accent); }
    .alt-portal a:hover { text-decoration: underline; }
    .legal-note { font-size: .75rem; color: var(--text-subtle); margin-top: 16px; text-align: center; line-height: 1.5; }
    .legal-note a { text-decoration: underline; }
    .switch-cta-box { margin-top: 22px; }
    .switch-link { margin-left: 2px; }

    /* ---------- alerts ---------- */
    .alert-banner { animation: fadeUp .3s var(--ease) both; }
    .alert-banner.success.status-pop { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; animation: popIn .45s var(--ease) both; }
    .alert-banner.success.status-pop i { font-size: 1.2rem; flex-shrink: 0; color: var(--ok); }

    /* ---------- "check your inbox" ---------- */
    .mail-art { position: relative; width: 92px; height: 92px; margin: 4px auto 18px; display: flex; align-items: center; justify-content: center; }
    .mail-ring { position: absolute; inset: 14px; border-radius: 50%; background: var(--accent); opacity: .25; animation: ringPulse 2.2s ease-out infinite; }
    .mail-ring::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); opacity: .5; animation: ringPulse 2.2s ease-out .8s infinite; }
    .mail-icon { position: relative; width: 70px; height: 70px; border-radius: 22px; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; font-size: 2rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 14px 28px -10px var(--accent-glow); animation: popIn .6s var(--ease) both, floaty 3.2s ease-in-out .6s infinite; }
    #sentStep strong, #forgotSent strong { color: var(--text-main); word-break: break-all; }
    #sentStep .btn-primary-auth, #forgotSent .btn-primary-auth { margin-top: 4px; }
    .tip-box { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0 4px; padding: 14px; background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-md); font-size: .82rem; color: #92400e; line-height: 1.5; text-align: left; }
    .tip-box i { font-size: 1.25rem; color: #d97706; flex-shrink: 0; margin-top: 1px; }
    .tip-box b { font-weight: 800; }
    .resend-link { background: none; border: 0; font: inherit; font-weight: 700; padding: 0; }
    .resend-link:not(.disabled):hover { text-decoration: underline; }

    @media (max-width: 480px) {
      .form-card h1 { font-size: 1.4rem; }
      .top-nav-bar { margin-bottom: 18px; }
      .strength-bars { flex-basis: 80px; }
    }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    }

    /* trainer application extras */
    textarea.input-box { min-height: 112px; resize: vertical; line-height: 1.5; }
    .opt { font-weight: 600; color: var(--text-subtle); font-size: .78rem; }
    .char-count { text-align: right; font-size: .72rem; color: var(--text-subtle); margin-top: 4px; }
    input.input-box[readonly] { background: #f8fafc; color: var(--text-muted); cursor: default; }
