/* ==========================================================================
   markXpand Auth Page — Split-Screen Layout
   ========================================================================== */

/* ---------- Variables (shared with landing page) ---------- */
:root {
    --auth-brand: #43a3dd;
    --auth-brand-dark: #2e7ba8;
    --auth-brand-light: #7ec4ed;
    --auth-brand-glow: rgba(67,163,221,.15);
    --auth-bg: #faf9f7;
    --auth-card: #ffffff;
    --auth-border: #ebebeb;
    --auth-text: #1a1a2e;
    --auth-text-body: #4a5568;
    --auth-text-muted: #718096;
    --auth-radius: 16px;
    --auth-radius-sm: 10px;
    --auth-radius-pill: 100px;
    --auth-font-h: 'Plus Jakarta Sans', system-ui, sans-serif;
    --auth-font-b: 'Inter', system-ui, sans-serif;
    --auth-ease: cubic-bezier(.4,0,.2,1);
}

/* ---------- Reset ---------- */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{font-family:var(--auth-font-b);font-size:16px;line-height:1.7;color:var(--auth-text-body);background:var(--auth-bg);-webkit-font-smoothing:antialiased;overflow-x:hidden;min-height:100vh}
img{max-width:100%;height:auto;display:block}
a{text-decoration:none;color:inherit}
input,button,textarea{font-family:inherit}

/* ---------- Utility ---------- */
.auth-link{color:var(--auth-brand);font-weight:600;transition:color .2s;cursor:pointer}
.auth-link:hover{color:var(--auth-brand-dark)}

/* ==========================================================================
   SPLIT SCREEN CONTAINER
   ========================================================================== */
.auth-container{display:flex;min-height:100vh;min-height:100dvh}

/* ---------- LEFT: Brand Panel ---------- */
.auth-brand-panel{
    width:50%;
    background:linear-gradient(145deg,#1a3a5c 0%,#2e7ba8 50%,#43a3dd 100%);
    color:#fff;
    display:flex;
    flex-direction:column;
    padding:40px;
    position:relative;
    overflow:hidden
}

.auth-brand-panel::before{
    content:'';
    position:absolute;
    top:-120px;right:-120px;
    width:400px;height:400px;
    border-radius:50%;
    background:rgba(255,255,255,.06);
    pointer-events:none
}

.auth-brand-panel::after{
    content:'';
    position:absolute;
    bottom:-80px;left:-80px;
    width:300px;height:300px;
    border-radius:50%;
    background:rgba(255,255,255,.04);
    pointer-events:none
}

.auth-brand-top{display:flex;align-items:center;justify-content:space-between;position:relative;z-index:1}

.auth-back{
    display:inline-flex;align-items:center;gap:6px;
    font-size:.875rem;font-weight:500;color:rgba(255,255,255,.7);
    transition:color .2s
}
.auth-back:hover{color:#fff}

.auth-brand-logo{height:30px;filter:brightness(0) invert(1)}

.auth-brand-content{
    flex:1;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    text-align:center;
    position:relative;
    z-index:1;
    gap:32px;
    padding:40px 0
}

.auth-brand-tagline{
    font-family:var(--auth-font-h);
    font-weight:800;
    font-size:clamp(1.5rem,2.5vw,2rem);
    line-height:1.25;
    max-width:380px
}

/* Mini mock dashboard */
.auth-mock-browser{
    width:100%;
    max-width:380px;
    background:rgba(255,255,255,.1);
    border-radius:var(--auth-radius);
    overflow:hidden;
    backdrop-filter:blur(8px);
    border:1px solid rgba(255,255,255,.12)
}

.auth-mock-topbar{
    background:rgba(255,255,255,.08);
    padding:8px 12px;
    display:flex;align-items:center;gap:8px;
    border-bottom:1px solid rgba(255,255,255,.08)
}

.auth-mock-dots{display:flex;gap:5px}
.auth-mock-dots span{width:8px;height:8px;border-radius:50%}
.auth-mock-dots span:nth-child(1){background:#ff5f57}
.auth-mock-dots span:nth-child(2){background:#febc2e}
.auth-mock-dots span:nth-child(3){background:#28c840}

.auth-mock-url{
    flex:1;background:rgba(255,255,255,.1);
    border-radius:4px;padding:3px 10px;
    font-size:10px;color:rgba(255,255,255,.5);
    font-family:var(--auth-font-b)
}

.auth-mock-body{padding:16px;display:flex;flex-direction:column;gap:10px}

.auth-mock-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}

.auth-mock-stat{
    background:rgba(255,255,255,.08);
    border-radius:8px;padding:10px 8px;
    text-align:center
}
.auth-mock-stat-label{font-size:8px;text-transform:uppercase;letter-spacing:.05em;color:rgba(255,255,255,.5);margin-bottom:3px}
.auth-mock-stat-value{font-family:var(--auth-font-h);font-weight:800;font-size:16px;color:#fff}

.auth-mock-bars{display:flex;align-items:flex-end;gap:6px;height:60px}
.auth-mock-bar{
    flex:1;border-radius:3px 3px 0 0;
    background:linear-gradient(180deg,rgba(255,255,255,.3),rgba(255,255,255,.12));
    height:var(--h)
}

/* Scene: mock browser + scattered icons */
.auth-scene{
    position:relative;
    width:100%;
    max-width:400px;
    padding:30px 0
}

/* Scattered platform icons */
.auth-pf{
    position:absolute;
    z-index:3;
    width:var(--pf-size,42px);height:var(--pf-size,42px);
    border-radius:50%;
    background:var(--p-color);
    display:flex;align-items:center;justify-content:center;
    color:#fff;
    font-size:var(--pf-font,.95rem);
    box-shadow:0 4px 18px rgba(0,0,0,.25),
               inset 0 1px 0 rgba(255,255,255,.2);
    animation:authFloat var(--pf-dur,3s) ease-in-out infinite var(--pf-delay,0s);
    cursor:default
}
.auth-pf i{display:flex;align-items:center;justify-content:center}

/* Individual scattered positions & animation variety */
.auth-pf--1{top:-8px;  left:4%;   --pf-size:44px;--pf-font:1.05rem;--pf-dur:3.2s;--pf-delay:0s}
.auth-pf--2{top:15%;   right:-6%; --pf-size:40px;--pf-font:.9rem;  --pf-dur:3.6s;--pf-delay:.4s}
.auth-pf--3{top:50%;   left:-12%;--pf-size:38px;--pf-font:.85rem; --pf-dur:2.8s;--pf-delay:.8s}
.auth-pf--4{bottom:25%;right:-8%;--pf-size:36px;--pf-font:.8rem;  --pf-dur:3.4s;--pf-delay:1.2s}
.auth-pf--5{bottom:-4px;left:12%; --pf-size:40px;--pf-font:.9rem;  --pf-dur:3s;  --pf-delay:.6s}
.auth-pf--6{bottom:10%;right:8%; --pf-size:42px;--pf-font:.95rem; --pf-dur:3.5s;--pf-delay:1s}
.auth-pf--7{top:5%;    left:42%; --pf-size:34px;--pf-font:.8rem;  --pf-dur:2.6s;--pf-delay:.2s}

@keyframes authFloat{
    0%,100%{transform:translateY(0)}
    50%{transform:translateY(-10px)}
}

/* hide scattered icons on mobile (no brand panel) */
@media(max-width:991px){
    .auth-pf{display:none}
    .auth-scene{padding:0}
}

/* Trust signals */
.auth-trust{
    display:flex;gap:24px;
    justify-content:center;
    position:relative;z-index:1;
    padding-bottom:8px
}

.auth-trust-item{
    display:flex;align-items:center;gap:6px;
    font-size:.75rem;color:rgba(255,255,255,.6)
}
.auth-trust-item i{font-size:.813rem;color:rgba(255,255,255,.4)}

/* ---------- RIGHT: Form Panel ---------- */
.auth-form-panel{
    width:50%;
    background:var(--auth-card);
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    padding:40px;
    position:relative;
    overflow-y:auto
}

/* Mobile logo header (hidden on desktop) */
.auth-mobile-header{
    display:none;
    width:100%;
    padding:16px 0 24px;
    text-align:center
}
.auth-mobile-header img{height:28px;display:inline-block}
.auth-mobile-back{
    position:absolute;top:16px;left:16px;
    font-size:.875rem;color:var(--auth-text-muted);
    display:none;align-items:center;gap:4px;
    transition:color .2s;z-index:10
}
.auth-mobile-back:hover{color:var(--auth-brand)}

/* Form wrapper */
.auth-form-wrapper{width:100%;max-width:420px}

/* Section titles */
.auth-form-title{
    font-family:var(--auth-font-h);
    font-weight:700;
    font-size:1.5rem;
    color:var(--auth-text);
    margin-bottom:4px
}
.auth-form-subtitle{font-size:.938rem;color:var(--auth-text-muted);margin-bottom:28px}

/* Form controls */
.auth-form-group{margin-bottom:18px}
.auth-form-group label{
    display:block;
    font-size:.813rem;
    font-weight:600;
    color:var(--auth-text);
    margin-bottom:6px
}

.auth-input{
    width:100%;
    border:2px solid var(--auth-border);
    border-radius:var(--auth-radius-sm);
    padding:11px 14px;
    font-size:.938rem;
    color:var(--auth-text);
    background:var(--auth-bg);
    transition:border-color .2s,box-shadow .2s
}
.auth-input:focus{
    border-color:var(--auth-brand);
    box-shadow:0 0 0 3px var(--auth-brand-glow);
    outline:none;
    background:#fff
}
.auth-input::placeholder{color:var(--auth-text-muted)}

.auth-input-group{display:flex}
.auth-input-group .auth-input{border-radius:var(--auth-radius-sm) 0 0 var(--auth-radius-sm)}
.auth-input-toggle{
    border:2px solid var(--auth-border);
    border-left:none;
    border-radius:0 var(--auth-radius-sm) var(--auth-radius-sm) 0;
    background:var(--auth-bg);
    color:var(--auth-text-muted);
    padding:0 14px;
    cursor:pointer;
    transition:color .2s
}
.auth-input-toggle:hover{color:var(--auth-brand)}

/* Buttons */
.auth-btn-primary{
    display:flex;align-items:center;justify-content:center;gap:8px;
    width:100%;
    font-family:var(--auth-font-h);font-weight:700;font-size:.938rem;
    padding:13px 24px;
    border-radius:var(--auth-radius-pill);
    background:linear-gradient(135deg,var(--auth-brand) 0%,var(--auth-brand-dark) 100%);
    color:#fff;border:none;cursor:pointer;
    transition:transform .25s var(--auth-ease),box-shadow .25s var(--auth-ease);
    box-shadow:0 4px 14px rgba(67,163,221,.3)
}
.auth-btn-primary:hover{transform:translateY(-2px);box-shadow:0 8px 24px rgba(67,163,221,.4)}
.auth-btn-primary:disabled{opacity:.6;cursor:not-allowed;transform:none;box-shadow:none}

.auth-btn-google{
    display:flex;align-items:center;justify-content:center;gap:10px;
    width:100%;
    background:var(--auth-card);
    border:2px solid var(--auth-border);
    border-radius:var(--auth-radius-sm);
    padding:11px;
    font-weight:600;font-size:.938rem;
    color:var(--auth-text);
    cursor:pointer;
    transition:all .2s
}
.auth-btn-google:hover{background:var(--auth-bg);border-color:var(--auth-text-muted)}

.auth-btn-test{
    display:flex;align-items:center;justify-content:center;gap:8px;
    width:100%;
    background:#ff6b35;color:#fff;
    font-weight:600;
    border:2px dashed #ff6b35;
    border-radius:var(--auth-radius-sm);
    padding:10px;
    cursor:pointer;
    margin-top:10px;
    transition:opacity .2s
}
.auth-btn-test:hover{opacity:.85;color:#fff}

/* Divider */
.auth-divider{
    text-align:center;
    position:relative;
    margin:22px 0
}
.auth-divider::before{
    content:'';position:absolute;
    top:50%;left:0;right:0;
    height:1px;background:var(--auth-border)
}
.auth-divider span{
    position:relative;
    background:var(--auth-card);
    padding:0 12px;
    font-size:.813rem;
    color:var(--auth-text-muted)
}

/* Switch text */
.auth-switch-text{
    text-align:center;
    font-size:.875rem;
    color:var(--auth-text-muted);
    margin-top:24px
}

/* Auth sections */
.auth-section{display:none;animation:authFadeIn .35s ease}
.auth-section.active{display:block}
@keyframes authFadeIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}

/* ==========================================================================
   OTP SECTION
   ========================================================================== */
.auth-otp-wrapper{text-align:center}

.auth-otp-icon{
    width:72px;height:72px;
    border-radius:50%;
    background:linear-gradient(135deg,var(--auth-brand),var(--auth-brand-dark));
    display:flex;align-items:center;justify-content:center;
    color:#fff;font-size:1.75rem;
    margin:0 auto 16px;
    animation:authPulse 2s ease-in-out infinite
}
@keyframes authPulse{0%,100%{box-shadow:0 0 0 0 rgba(67,163,221,.4)}50%{box-shadow:0 0 0 16px rgba(67,163,221,0)}}

.auth-otp-inputs{display:flex;justify-content:center;gap:10px;margin:20px 0}

.auth-otp-input{
    width:48px;height:56px;
    text-align:center;
    font-size:22px;font-weight:700;
    border:2px solid var(--auth-border);
    border-radius:var(--auth-radius-sm);
    background:var(--auth-bg);
    transition:all .2s;
    color:var(--auth-text)
}
.auth-otp-input:focus{
    outline:none;
    border-color:var(--auth-brand);
    background:var(--auth-card);
    box-shadow:0 0 0 3px var(--auth-brand-glow);
    transform:scale(1.05)
}
.auth-otp-input.filled{
    background:linear-gradient(135deg,var(--auth-brand),var(--auth-brand-dark));
    color:#fff;border-color:var(--auth-brand)
}
.auth-otp-input.error{border-color:#e53e3e;animation:authShake .3s ease-in-out}
@keyframes authShake{0%,100%{transform:translateX(0)}25%{transform:translateX(-8px)}75%{transform:translateX(8px)}}

.auth-otp-error{color:#e53e3e;font-size:.875rem;margin:8px 0;display:none}
.auth-otp-success{color:#38a169;font-size:.875rem;margin:8px 0;display:none}

.auth-resend-area{margin-top:16px;font-size:.875rem;color:var(--auth-text-muted)}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.auth-toast-container{position:fixed;top:20px;right:20px;z-index:9999;display:flex;flex-direction:column;gap:8px}

.auth-toast{
    min-width:280px;
    padding:12px 16px;
    border-radius:var(--auth-radius-sm);
    font-size:.875rem;font-weight:500;
    box-shadow:0 4px 16px rgba(0,0,0,.12);
    display:flex;align-items:center;gap:8px;
    animation:authSlideIn .3s ease;
    position:relative
}
.auth-toast--success{background:#f0fff4;color:#22543d;border:1px solid #c6f6d5}
.auth-toast--error{background:#fff5f5;color:#742a2a;border:1px solid #fed7d7}
.auth-toast-close{
    margin-left:auto;
    background:none;border:none;
    font-size:1rem;color:inherit;
    opacity:.5;cursor:pointer
}
.auth-toast-close:hover{opacity:1}
@keyframes authSlideIn{from{opacity:0;transform:translateX(40px)}to{opacity:1;transform:translateX(0)}}

/* ==========================================================================
   TERMS MODAL
   ========================================================================== */
.auth-terms-overlay{
    position:fixed;inset:0;
    background:rgba(0,0,0,.5);
    z-index:10000;
    display:none;
    align-items:center;justify-content:center;
    padding:20px
}
.auth-terms-overlay.active{display:flex}

.auth-terms-dialog{
    background:var(--auth-card);
    border-radius:var(--auth-radius);
    max-width:700px;width:100%;
    max-height:80vh;
    display:flex;flex-direction:column;
    box-shadow:0 25px 80px rgba(0,0,0,.2)
}

.auth-terms-header{
    display:flex;align-items:center;justify-content:space-between;
    padding:20px 24px;
    border-bottom:1px solid var(--auth-border)
}
.auth-terms-header h5{
    font-family:var(--auth-font-h);font-weight:700;
    font-size:1.125rem;color:var(--auth-text);
    margin:0
}
.auth-terms-close{
    background:none;border:none;
    font-size:1.25rem;color:var(--auth-text-muted);
    cursor:pointer;width:36px;height:36px;
    border-radius:50%;display:flex;
    align-items:center;justify-content:center;
    transition:background .2s
}
.auth-terms-close:hover{background:var(--auth-bg)}

.auth-terms-body{
    padding:24px;
    overflow-y:auto;
    flex:1;
    line-height:1.8;
    color:var(--auth-text-body)
}
.auth-terms-body h4{
    font-family:var(--auth-font-h);
    font-weight:700;
    color:var(--auth-text);
    margin-bottom:8px
}

/* ==========================================================================
   RTL SUPPORT
   ========================================================================== */
[dir="rtl"] .auth-container{flex-direction:row-reverse}
[dir="rtl"] .auth-back i{transform:rotate(180deg)}
[dir="rtl"] .auth-mobile-back i{transform:rotate(180deg)}
[dir="rtl"] .auth-input-group .auth-input{border-radius:0 var(--auth-radius-sm) var(--auth-radius-sm) 0}
[dir="rtl"] .auth-input-toggle{border-radius:var(--auth-radius-sm) 0 0 var(--auth-radius-sm);border-left:2px solid var(--auth-border);border-right:none}
[dir="rtl"] .auth-toast-container{right:auto;left:20px}
[dir="rtl"] .auth-form-group label{text-align:right}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media(max-width:991px){
    .auth-brand-panel{display:none}
    .auth-form-panel{width:100%;padding:24px 20px}
    .auth-mobile-header{display:block}
    .auth-mobile-back{display:flex}
}

@media(max-width:480px){
    .auth-form-panel{padding:16px}
    .auth-form-title{font-size:1.25rem}
    .auth-otp-input{width:40px;height:48px;font-size:18px}
    .auth-otp-inputs{gap:6px}
}

/* ==========================================================================
   SPINNER (Bootstrap-free replacement)
   ========================================================================== */
.spinner-border{
    display:inline-block;
    width:2rem;height:2rem;
    vertical-align:-.125em;
    border:.25em solid currentColor;
    border-right-color:transparent;
    border-radius:50%;
    animation:authSpin .75s linear infinite
}
.spinner-border-sm{width:1rem;height:1rem;border-width:.2em}
@keyframes authSpin{to{transform:rotate(360deg)}}

/* iOS input zoom fix */
input[type="text"],input[type="email"],input[type="password"],textarea,select{font-size:16px}
