/* ================================================
   auth.css — Login & Signup Page Styles
   ================================================ */

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

html, body.auth-body {
    min-height: 100dvh;
    margin: 0;
    font-family: var(--font-body);
    background: var(--slate-50);
    overflow-x: visible; /* Fix position: sticky */
}

body.auth-login {
    height: 100dvh;
    overflow: hidden !important;
}

.auth-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100dvh;
}

body.auth-login .auth-split {
    height: 100dvh;
}

.auth-split--reverse {
    grid-template-columns: 1fr 1fr;
}

/* ---- Left Branding Panel ---- */
.auth-panel-left {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.85) 0%, rgba(12, 42, 74, 0.75) 100%), url('../images/auth-bg.jpg') center/cover no-repeat;
    position: sticky;
    top: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 52px;
    color: var(--white);
    overflow: hidden;
}

.auth-panel-left::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -120px;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(6,182,212,0.18) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-panel-left::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(2,132,199,0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* ---- Brand Logo ---- */
.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-bottom: 36px;
}

.auth-logo img {
    height: 65px;
    max-width: 220px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.auth-logo span {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

/* ---- Headline ---- */
.auth-panel-headline {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    margin: 0 0 16px;
    letter-spacing: -0.03em;
}

.auth-panel-sub {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.85);
    line-height: 1.6;
    max-width: 440px;
    margin-bottom: 0;
}

/* ---- Trust Badges ---- */
.auth-trust-badges {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.auth-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    font-weight: 500;
}

.auth-badge svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: #06b6d4;
}

/* ---- Perks (signup panel) ---- */
.auth-perks {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.auth-perk {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auth-perk-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.auth-perk strong {
    display: block;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.auth-perk span {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.55);
}

/* ---- Right Form Panel ---- */
.auth-panel-right {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Safest way for standard flow */
    padding: 48px 40px;
    background: var(--slate-50);
}

/* ---- Form Card ---- */
.auth-form-card {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.auth-form-header {
    margin-bottom: 32px;
}

.auth-form-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--slate-900);
    letter-spacing: -0.03em;
    margin: 0 0 8px;
}

.auth-form-subtitle {
    font-size: 0.95rem;
    color: var(--slate-500);
    margin: 0;
}

/* ---- Alert Box ---- */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.auth-alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.auth-alert--error svg { stroke: #b91c1c; }

.auth-alert--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.auth-alert--success svg { stroke: #15803d; }

/* ---- Form ---- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-form input[type="hidden"] {
    display: none !important;
}

.auth-fields-group {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 0;
    padding: 0;
    border: none;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 0;
    padding: 0;
}

.auth-help-text {
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.4;
    margin-top: 2px;
    display: block;
}

.auth-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--slate-700);
    margin-left: 2px;
}

.auth-label-link {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--primary-cyan);
    text-decoration: none;
    transition: opacity 0.15s;
}

.auth-label-link:hover { opacity: 0.75; }

/* ---- Input Wrapper ---- */
.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--slate-400);
    stroke: var(--slate-400);
    pointer-events: none;
    transition: all var(--transition-fast);
    z-index: 1;
}

.auth-input {
    width: 100%;
    border: 2px solid var(--slate-200);
    border-radius: 8px;
    background: #f8fafc;
    padding: 14px 16px 14px 44px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--slate-900);
    transition: all var(--transition-fast);
}

.auth-input::placeholder { color: var(--slate-400); }

.auth-input:focus {
    outline: none;
    border-color: var(--primary-cyan);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.1);
}

.auth-input:focus ~ .auth-input-icon,
.auth-input-wrapper:focus-within .auth-input-icon {
    stroke: var(--primary-cyan);
}

.auth-input:disabled {
    background: var(--slate-100);
    color: var(--slate-400);
    cursor: not-allowed;
}

/* ---- Show/Hide Password Toggle ---- */
.auth-toggle-pw {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.auth-toggle-pw svg {
    width: 18px;
    height: 18px;
    stroke: var(--slate-400);
    transition: stroke 0.2s;
}

.auth-toggle-pw:hover svg,
.auth-toggle-pw.active svg { stroke: var(--primary-cyan); }

/* ---- Submit Button ---- */
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary-cyan) 0%, var(--primary-blue) 100%);
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(6,182,212,0.25);
    margin-top: 4px;
}

.auth-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
}

.auth-btn:hover:not(:disabled) {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(6,182,212,0.38);
}

.auth-btn:hover:not(:disabled) svg { transform: translateX(3px); }

.auth-btn:active:not(:disabled) { transform: translateY(0); }

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---- Switch Link ---- */
.auth-switch {
    text-align: center;
    font-size: 0.9rem;
    color: var(--slate-500);
    margin-top: 24px;
}

.auth-switch a {
    color: var(--primary-cyan);
    font-weight: 600;
    text-decoration: none;
}

.auth-switch a:hover { text-decoration: underline; }

/* ---- Security Note ---- */
.auth-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--slate-400);
}

.auth-security-note svg {
    width: 13px;
    height: 13px;
    stroke: var(--accent-green);
}

/* ---- Password Strength */
.pw-strength-bar {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    height: 4px;
}

.pw-strength-bar span {
    flex: 1;
    background: var(--slate-200);
    border-radius: 2px;
    transition: background var(--transition-fast);
}

.pw-strength-bar span.weak   { background: #ef4444; } /* Red */
.pw-strength-bar span.fair   { background: #eab308; } /* Yellow */
.pw-strength-bar span.good   { background: #84cc16; } /* Light Green */
.pw-strength-bar span.strong { background: #22c55e; } /* Green */

.pw-strength-label {
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 6px;
    color: var(--slate-500);
    text-align: right;
}
.pw-strength-label.weak   { color: #ef4444; }
.pw-strength-label.fair   { color: #eab308; }
.pw-strength-label.good   { color: #84cc16; }
.pw-strength-label.strong { color: #22c55e; }

.pw-rules {
    list-style: none;
    margin: 10px 0 16px 0;
    padding: 0;
    font-size: 0.8rem;
    color: var(--slate-500);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
}
.pw-rules li {
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
}
.pw-rules li::before {
    content: "○";
    font-size: 0.95rem;
    line-height: 1;
    color: var(--slate-400);
}
.pw-rules li.met {
    color: #16a34a;
    font-weight: 600;
}
.pw-rules li.met::before {
    content: '✓';
    color: #16a34a;
    font-weight: 700;
}
@media (max-width: 480px) {
    .pw-rules {
        grid-template-columns: 1fr;
    }
}

/* ---- Navbar Links Fix ---- */
.auth-split .auth-panel-left a.auth-logo {
    margin-bottom: 0;
}
.auth-brand-block { display: flex; flex-direction: column; }
.auth-brand-block .auth-logo { margin-bottom: 48px; }

/* ========= RESPONSIVE ========= */
@media (max-width: 900px) {
    html, body.auth-body {
        background: var(--white);
    }

    body.auth-login {
        height: 100dvh;
        overflow: hidden !important;
    }

    body.auth-login .auth-split {
        height: 100dvh;
        overflow: hidden;
    }

    .auth-split,
    .auth-split--reverse {
        display: flex;
        flex-direction: column;
        min-height: 100dvh;
        background: var(--white);
    }

    .auth-panel-left {
        display: none; /* Hide branding panel completely on mobile */
    }

    .auth-panel-right {
        padding: 0 24px 40px;
        background: var(--white);
        display: flex;
        flex-direction: column;
        flex: 1;
        justify-content: center;
    }

    .auth-form-card { max-width: 100%; margin: 0 auto; }

    /* Show normal logo header instead of floating white one */
    .mobile-auth-logo {
        display: flex !important;
        justify-content: center;
        align-items: center;
        gap: 8px;
        color: var(--slate-900);
        font-size: 1.5rem;
        font-weight: 700;
        text-decoration: none;
        margin-top: 40px;
        margin-bottom: 32px;
    }
    .mobile-auth-logo img {
        height: 48px;
        max-width: 180px;
        width: auto;
        object-fit: contain;
    }
    
    .auth-form-header { margin-bottom: 24px; }
    .auth-form-title { font-size: 1.7rem; }
    .auth-form-subtitle { font-size: 0.85rem; }
    .auth-form { gap: 16px; }
    .auth-field { gap: 6px; }
    .auth-label { font-size: 0.8rem; }
    .auth-input { padding: 12px 14px 12px 40px; font-size: 0.9rem; }
    .auth-btn { padding: 12px 24px; font-size: 0.95rem; }
    .auth-switch { font-size: 0.85rem; }
}

@media (max-width: 480px) {
    .auth-panel-right { padding: 0 20px 32px; }
}
