/*
 * portal/assets/css/auth.css
 * Auth pages: login, signup
 * Brand: OYSHC — Oyo State Housing Corporation
 */

/* ─── Base Reset ──────────────────────────────────────────── */
html, body { margin: 0; padding: 0; }

/* ─── Design Tokens ─────────────────────────────────────────── */
:root {
    --auth-primary:        hsl(145, 55%, 27%);
    --auth-primary-light:  hsl(145, 55%, 45%);
    --auth-primary-dark:   hsl(145, 55%, 15%);
    --auth-secondary:      hsl(217, 67%, 36%);
    --auth-secondary-light:hsl(217, 67%, 50%);
    --auth-bg:             #f1f5f9;
    --auth-card:           #ffffff;
    --auth-text:           #0f172a;
    --auth-muted:          #64748b;
    --auth-border:         rgba(0, 0, 0, 0.08);
    --auth-input-bg:       rgba(241, 245, 249, 0.5);
    --auth-shadow:         0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.08);
}

/* ─── Keyframe Animations ───────────────────────────────────── */
@keyframes auth-fade-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes auth-fade-left {
    from { opacity: 0; transform: translateX(32px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes auth-fade-right {
    from { opacity: 0; transform: translateX(-32px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes auth-float {
    0%, 100% { transform: translateY(0px);  }
    50%       { transform: translateY(-8px); }
}
@keyframes auth-spin {
    to { transform: rotate(360deg); }
}
@keyframes auth-pulse-ring {
    0%   { box-shadow: 0 0 0 0px hsla(145,55%,27%,0.4); }
    100% { box-shadow: 0 0 0 16px hsla(145,55%,27%,0.0); }
}
@keyframes auth-shimmer {
    from { background-position: -400px 0; }
    to   { background-position: 400px 0; }
}

/* ─── Page Background ───────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--auth-bg);
}

/* ─── Brand Panel (left / right half) ──────────────────────── */
.auth-brand-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 4rem 3.5rem;
    background: linear-gradient(145deg,
        hsl(145, 55%, 18%) 0%,
        hsl(145, 55%, 27%) 45%,
        hsl(217, 67%, 32%) 100%
    );
    color: white;
    animation: auth-fade-right 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Decorative orbs */
.auth-brand-panel::before,
.auth-brand-panel::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.auth-brand-panel::before {
    width: 400px; height: 400px;
    top: -120px; right: -120px;
    background: radial-gradient(circle, hsla(217,67%,50%,0.35) 0%, transparent 70%);
}
.auth-brand-panel::after {
    width: 300px; height: 300px;
    bottom: -80px; left: -80px;
    background: radial-gradient(circle, hsla(145,55%,50%,0.2) 0%, transparent 70%);
}

.auth-brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    z-index: 1;
}
.auth-brand-logo-icon {
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
}
.auth-brand-logo-text {
    display: flex; flex-direction: column;
}
.auth-brand-logo-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.01em;
    line-height: 1;
}
.auth-brand-logo-sub {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.65);
    margin-top: 0.2rem;
    letter-spacing: 0.03em;
}

.auth-brand-headline {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
    z-index: 1;
}
.auth-brand-headline span {
    opacity: 0.7;
}
.auth-brand-body {
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.75);
    max-width: 380px;
    z-index: 1;
    margin-bottom: 2.5rem;
}

/* Trust Badges */
.auth-trust-badges {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1;
}
.auth-trust-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    padding: 0.75rem 1rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.9);
    transition: background 0.2s;
}
.auth-trust-badge:hover {
    background: rgba(255,255,255,0.15);
}
.auth-trust-badge i {
    color: #86efac; /* green-300 */
    font-size: 1rem;
    width: 18px; text-align: center;
}

/* Steps (signup) */
.auth-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 1;
    margin-top: 0.5rem;
}
.auth-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.auth-step-num {
    width: 32px; height: 32px;
    min-width: 32px;
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
}
.auth-step-num.done {
    background: #86efac;
    border-color: #86efac;
    color: #14532d;
}
.auth-step-info strong {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    margin-bottom: 0.2rem;
}
.auth-step-info span {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.5;
}

/* ─── Form Panel ────────────────────────────────────────────── */
.auth-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 3.5rem;
    background: var(--auth-card);
    animation: auth-fade-left 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    overflow-y: auto;
}

.auth-form-inner {
    max-width: 400px;
    width: 100%;
}

/* ─── Auth Icon ─────────────────────────────────────────────── */
.auth-icon-wrap {
    width: 56px; height: 56px;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-secondary));
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px -3px hsla(145, 55%, 27%, 0.4);
    animation: auth-float 4s ease-in-out infinite;
}
.auth-icon-wrap svg,
.auth-icon-wrap i { color: white; }

/* ─── Headings ──────────────────────────────────────────────── */
.auth-form-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--auth-text);
    letter-spacing: -0.02em;
    margin: 0 0 0.4rem;
}
.auth-form-subtitle {
    font-size: 0.9rem;
    color: var(--auth-muted);
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* ─── Form Controls ─────────────────────────────────────────── */
.auth-form-row {
    display: flex;
    gap: 1rem;
}
.auth-form-row > * { flex: 1; min-width: 0; }

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
}
.auth-field label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--auth-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.auth-field-hint {
    font-size: 0.75rem;
    color: var(--auth-muted);
    line-height: 1.4;
    min-height: 2.8em;
    display: flex;
    align-items: flex-end;
}
.auth-input-wrap {
    position: relative;
}
.auth-input {
    width: 100%;
    height: 46px; /* Explicit height for consistency */
    padding: 0 1rem;
    border: 1.5px solid var(--auth-border);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    background: var(--auth-input-bg);
    color: var(--auth-text);
    box-sizing: border-box; /* Ensure padding doesn't affect height */
}
.auth-input.has-icon-right { padding-right: 3.25rem; }

/* ─── Multi-step Wizard Styles ────────────────────────────── */
.auth-wizard-steps {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}
.auth-wizard-step-indicator {
    flex: 1;
    height: 4px;
    background: var(--auth-border);
    border-radius: 2px;
    transition: background 0.3s;
}
.auth-wizard-step-indicator.active {
    background: var(--auth-primary);
}
.auth-wizard-step-indicator.completed {
    background: var(--auth-primary-light);
}

.auth-form-step {
    display: none;
    animation: auth-fade-left 0.4s ease-out forwards;
}
.auth-form-step.active {
    display: block;
}

.auth-step-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.auth-btn-secondary {
    background: transparent;
    border: 1.5px solid var(--auth-border);
    color: var(--auth-muted);
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}
.auth-btn-secondary:hover {
    border-color: var(--auth-muted);
    color: var(--auth-text);
    background: var(--auth-input-bg);
}

.auth-input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px hsla(145, 55%, 40%, 0.18);
    background: white;
}
.auth-input::placeholder { color: var(--auth-muted); opacity: 0.6; }
.auth-input.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* Password eye toggle */
.auth-eye-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--auth-muted);
    cursor: pointer;
    padding: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    transition: color 0.2s, background 0.2s;
    border-radius: 0.375rem;
    width: 32px;
    height: 32px;
}
.auth-eye-toggle:hover { 
    color: var(--auth-text); 
    background: rgba(0, 0, 0, 0.04);
}
.auth-eye-toggle i {
    font-size: 1.1rem;
}

/* Password strength bar */
.auth-strength-bar {
    display: flex;
    gap: 3px;
    margin-top: 0.4rem;
}
.auth-strength-bar span {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--auth-border);
    transition: background 0.3s;
}
.auth-strength-bar[data-strength="1"] span:nth-child(1) { background: #ef4444; }
.auth-strength-bar[data-strength="2"] span:nth-child(-n+2) { background: #f97316; }
.auth-strength-bar[data-strength="3"] span:nth-child(-n+3) { background: #eab308; }
.auth-strength-bar[data-strength="4"] span:nth-child(-n+4) { background: var(--auth-primary); }

/* ─── Submit Button ─────────────────────────────────────────── */
.auth-btn {
    position: relative;
    width: 100%;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-secondary));
    color: #fff;
    border: none;
    padding: 0.85rem 1rem;
    font-size: 0.9375rem;
    font-weight: 700;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px hsla(145, 55%, 27%, 0.3);
    letter-spacing: 0.02em;
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
}
.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -3px hsla(145, 55%, 27%, 0.4);
    filter: brightness(1.08);
}
.auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 6px -1px hsla(145, 55%, 27%, 0.3);
    filter: brightness(1);
}
.auth-btn.is-loading {
    pointer-events: none;
    opacity: 0.85;
}
.auth-btn.is-loading .auth-btn-text { opacity: 0; }
.auth-btn.is-loading::after {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    top: 50%; left: 50%;
    margin-top: -10px; margin-left: -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: auth-spin 0.8s linear infinite;
}

/* ─── Links ─────────────────────────────────────────────────── */
.auth-link {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}
.auth-link:hover {
    color: var(--auth-primary-light);
    text-decoration: underline;
}
.auth-form-footer {
    text-align: center;
    font-size: 0.875rem;
    color: var(--auth-muted);
}
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--auth-muted);
    font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

/* ─── Alerts ─────────────────────────────────────────────────── */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
    transition: opacity 0.5s ease;
}
.auth-alert.is-error {
    background: rgba(239, 68, 68, 0.08);
    border-left: 3px solid #ef4444;
    color: #991b1b;
}
.auth-alert.is-success {
    background: hsla(145, 55%, 40%, 0.1);
    border-left: 3px solid var(--auth-primary);
    color: var(--auth-primary-dark);
}
.auth-alert.is-info {
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid #3b82f6;
    color: #1d4ed8;
}
.auth-alert i { margin-top: 0.1rem; flex-shrink: 0; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
    .auth-page {
        grid-template-columns: 1fr;
        min-height: 100vh;
        height: auto;
        overflow: auto;
    }
    .auth-brand-panel {
        padding: 3rem 1.5rem;
        min-height: auto;
        align-items: center;
        text-align: center;
        animation: auth-fade-up 0.5s ease-out forwards;
    }
    .auth-brand-logo { margin-bottom: 1.5rem; }
    .auth-brand-headline { 
        font-size: 1.75rem; 
        margin-bottom: 1rem;
    }
    .auth-brand-body { display: none; }
    
    /* Horizontal steps for mobile */
    .auth-steps {
        flex-direction: row;
        gap: 1rem;
        margin-top: 1rem;
    }
    .auth-step-info { display: none; } /* Hide text in sidebar on mobile */
    .auth-step-num {
        width: 36px; height: 36px;
        font-size: 0.9rem;
    }

    .auth-form-panel {
        padding: 2rem 1.5rem 4rem;
        margin-top: -2rem; /* Overlap effect */
        border-top-left-radius: 2rem;
        border-top-right-radius: 2rem;
        background: #fff;
        box-shadow: 0 -10px 25px rgba(0,0,0,0.05);
        z-index: 2;
        animation: auth-fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    .auth-form-inner { max-width: 100%; }
    
    .auth-icon-wrap { margin-left: auto; margin-right: auto; }
    .auth-form-title, .auth-form-subtitle { text-align: center; }
}

@media (max-width: 520px) {
    .auth-brand-panel { padding: 2.5rem 1rem 3.5rem; }
    .auth-brand-headline { font-size: 1.5rem; }
    .auth-trust-badges { display: none; }
    .auth-form-row { flex-direction: column; gap: 0; }
    .auth-btn { padding: 1rem; } /* Chunkier buttons for thumbs */
    
    .auth-wizard-steps { margin-bottom: 1.5rem; }
}
