/* ============================================================
   auth.css — Modern split-screen auth layout
   Used by: login, register, passwords/email
   ============================================================ */

/* ── Outer shell ── */
.auth-shell {
    min-height: calc(100vh - 120px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    direction: rtl;
}

/* ── Branded left panel (on RTL this is the RIGHT visual column) ── */
.auth-brand {
    background: linear-gradient(155deg, var(--navy) 0%, #1a4a7a 50%, var(--teal) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 52px;
    position: relative;
    overflow: hidden;
}

/* decorative blobs */
.auth-brand::before,
.auth-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.auth-brand::before {
    width: 340px;
    height: 340px;
    background: rgba(255,255,255,.055);
    top: -80px;
    inset-inline-end: -100px;
}
.auth-brand::after {
    width: 220px;
    height: 220px;
    background: rgba(14,124,123,.25);
    bottom: -60px;
    inset-inline-start: -40px;
}

.auth-brand__logo {
    height: 40px;
    margin-bottom: 52px;
    position: relative;
    z-index: 1;
}

.auth-brand__headline {
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.35;
    margin: 0 0 14px;
    position: relative;
    z-index: 1;
}

.auth-brand__sub {
    font-size: 14.5px;
    color: rgba(255,255,255,.72);
    line-height: 1.7;
    margin: 0 0 40px;
    max-width: 340px;
    position: relative;
    z-index: 1;
}

.auth-brand__features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
    z-index: 1;
}

.auth-brand__feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    color: rgba(255,255,255,.9);
    font-size: 14px;
    line-height: 1.55;
}

.auth-brand__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.auth-brand__feature-text strong {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 2px;
    color: #fff;
}

.auth-brand__badge {
    margin-top: 48px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 100px;
    padding: 7px 16px;
    font-size: 12.5px;
    color: rgba(255,255,255,.82);
    position: relative;
    z-index: 1;
}

.auth-brand__badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    animation: auth-pulse 2s ease-in-out infinite;
}

@keyframes auth-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .5; transform: scale(.8); }
}

/* ── Form panel ── */
.auth-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding: 48px 52px;
    background: #ffffff;
    overflow-y: auto;
}

.auth-form-inner {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

/* ── Mobile hero — hidden on desktop, shown on mobile ── */
.auth-mobile-hero {
    display: none;
    background: linear-gradient(135deg, var(--navy) 0%, #1a4a7a 60%, var(--teal) 100%);
    border-radius: 16px;
    padding: 24px 20px 20px;
    margin-bottom: 28px;
    text-align: center;
}
.auth-mobile-hero__logo {
    height: 36px;
    margin: 0 auto 12px;
    filter: brightness(0) invert(1);
}
.auth-mobile-hero__tagline {
    font-size: 13.5px;
    color: rgba(255,255,255,.82);
    margin: 0 0 16px;
    line-height: 1.5;
}
.auth-mobile-hero__pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.auth-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 100px;
    padding: 5px 12px;
    font-size: 12px;
    color: rgba(255,255,255,.9);
    white-space: nowrap;
}

/* ── Headings ── */
.auth-heading {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--navy);
    margin: 0 0 6px;
    line-height: 1.2;
}

.auth-tagline {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 30px;
    line-height: 1.55;
}

/* ── Google button ── */
.auth-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 16px;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 12px;
    background: #fff;
    color: var(--navy);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
    margin-bottom: 10px;
}
.auth-google:hover {
    background: var(--bg, #f8fafc);
    border-color: #bbb;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    color: var(--navy);
    text-decoration: none;
}
.auth-google svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Divider ── */
.auth-sep {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    font-size: 12.5px;
    color: var(--text-muted);
}
.auth-sep::before,
.auth-sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border, #e2e8f0);
}

/* ── Form groups ── */
.af-group {
    margin-bottom: 18px;
}

.af-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-mid, #475569);
    margin-bottom: 6px;
}

.auth-shell .af-group input,
.af-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 10px;
    font-family: var(--font, 'Almarai', sans-serif);
    font-size: 14.5px;
    color: var(--text, #1e293b);
    background: #fff;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
    box-sizing: border-box;
    display: block;
    direction: rtl;
}

.auth-shell .af-group input:focus,
.af-group input:focus {
    border-color: var(--teal, #0e7c7b);
    box-shadow: 0 0 0 3px rgba(14,124,123,.12);
}

.af-group .af-err {
    font-size: 12px;
    color: var(--danger, #dc3545);
    margin-top: 5px;
    display: block;
}

/* ── Name row (first + last side by side) ── */
.af-name-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ── Password with toggle ── */
.af-pw-wrap {
    position: relative;
}
.af-pw-wrap input {
    padding-inline-end: 44px;
}
.af-pw-toggle {
    position: absolute;
    inset-inline-end: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1;
    padding: 2px;
    border-radius: 4px;
    transition: color .15s;
}
.af-pw-toggle:hover { color: var(--teal); }

/* ── Remember / forgot row ── */
.af-remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    font-size: 13px;
}
.af-remember-row label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-mid);
    cursor: pointer;
    user-select: none;
}
.af-remember-row input[type=checkbox] {
    width: 15px;
    height: 15px;
    accent-color: var(--teal);
}
.af-remember-row a {
    color: var(--teal);
    font-size: 13px;
    text-decoration: none;
}
.af-remember-row a:hover { text-decoration: underline; }

/* ── Terms row ── */
.af-terms-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 22px;
    font-size: 13px;
    color: var(--text-mid);
    line-height: 1.55;
}
.af-terms-row input[type=checkbox] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: var(--teal);
    flex-shrink: 0;
}
.af-terms-row a {
    color: var(--teal);
    text-decoration: none;
}
.af-terms-row a:hover { text-decoration: underline; }

.af-terms-err {
    font-size: 12px;
    color: var(--danger, #dc3545);
    margin-block-start: -14px;
    margin-block-end: 16px;
    display: block;
}
.af-terms-err[hidden] { display: none; }

/* ── Submit button ── */
.af-submit {
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    border: none;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    background: var(--teal);
    color: #fff;
    cursor: pointer;
    transition: background .18s, transform .1s, box-shadow .18s;
    box-shadow: 0 4px 14px rgba(14,124,123,.28);
}
.af-submit:hover {
    background: var(--teal-light, #0f8f8e);
    box-shadow: 0 6px 18px rgba(14,124,123,.36);
}
.af-submit:active { transform: scale(.98); }
.af-submit:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
}

/* ── Footer link ── */
.af-foot {
    text-align: center;
    margin-top: 24px;
    font-size: 13.5px;
    color: var(--text-muted);
}
.af-foot a {
    color: var(--teal);
    font-weight: 700;
    text-decoration: none;
}
.af-foot a:hover { text-decoration: underline; }

/* ── Back link (password reset) ── */
.af-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
    margin-bottom: 28px;
    transition: color .15s;
}
.af-back:hover { color: var(--teal); text-decoration: none; }

/* ── Alert notices ── */
.af-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.55;
}
.af-notice--info {
    background: #eff8ff;
    border: 1px solid #93c5fd;
    color: #1d4ed8;
}
.af-notice--success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}
.af-notice svg { flex-shrink: 0; margin-top: 1px; }

/* ── Strength indicator ── */
.af-strength {
    height: 3px;
    border-radius: 99px;
    background: var(--border, #e2e8f0);
    margin-top: 6px;
    overflow: hidden;
}
.af-strength__bar {
    height: 100%;
    border-radius: 99px;
    width: 0;
    transition: width .3s, background .3s;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .auth-brand { display: none; }
    .auth-mobile-hero { display: block; }
    .auth-form-panel {
        padding: 28px 20px 40px;
        justify-content: flex-start;
    }
    .auth-form-inner { max-width: 100%; }
}

@media (max-width: 480px) {
    .auth-form-panel { padding: 28px 18px; }
    .af-name-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .af-name-row .af-group { margin-bottom: 18px; }
    .auth-heading { font-size: 1.4rem; }
}
