/* WattHub Login — split-panel auth (matches landing design system) */

:root {
    --auth-primary: #2563eb;
    --auth-primary-dark: #1d4ed8;
    --auth-primary-light: #eff6ff;
    --auth-accent: #10b981;
    --auth-accent-light: #ecfdf5;
    --auth-text: #0f172a;
    --auth-text-soft: #334155;
    --auth-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-bg: #f8fafc;
    --auth-card: #ffffff;
    --auth-gradient: linear-gradient(145deg, #1e40af 0%, #2563eb 38%, #059669 100%);
    --auth-shadow: 0 24px 56px rgba(37, 99, 235, 0.14);
    --auth-radius: 20px;
    --auth-font: Vazir, Tahoma, "Segoe UI", sans-serif;
}

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

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.auth-body {
    margin: 0;
    font-family: var(--auth-font);
    font-size: 15px;
    line-height: 1.75;
    color: var(--auth-text-soft);
    background: var(--auth-bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-page {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ── Showcase panel ── */
.auth-showcase {
    position: relative;
    background: var(--auth-gradient);
    color: #fff;
    padding: clamp(32px, 5vw, 56px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.auth-showcase::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.12), transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08), transparent 40%);
    pointer-events: none;
}

.auth-showcase::after {
    content: '';
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    bottom: -180px;
    left: -120px;
    pointer-events: none;
}

.auth-showcase > * { position: relative; z-index: 1; }

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #fff;
    font-weight: 800;
    font-size: 1.35rem;
}

.auth-brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: grid;
    place-items: center;
    font-size: 22px;
    backdrop-filter: blur(8px);
}

.auth-brand small {
    display: block;
    font-size: 11px;
    font-weight: 500;
    opacity: 0.82;
    margin-top: 2px;
}

.auth-showcase-content {
    max-width: 480px;
    margin: auto 0;
    padding: 40px 0;
}

.auth-showcase-content h2 {
    color: #fff;
    font-size: clamp(1.75rem, 3.5vw, 2.35rem);
    font-weight: 800;
    line-height: 1.35;
    margin: 0 0 18px;
    letter-spacing: -0.02em;
}

.auth-showcase-content p {
    margin: 0 0 32px;
    font-size: 1.05rem;
    line-height: 1.9;
    opacity: 0.92;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    font-weight: 600;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    backdrop-filter: blur(8px);
}

.auth-features li i {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.16);
    display: grid;
    place-items: center;
    font-size: 15px;
    flex-shrink: 0;
}

.auth-showcase-footer {
    font-size: 12px;
    opacity: 0.65;
}

/* ── Form panel ── */
.auth-main {
    display: flex;
    flex-direction: column;
    padding: clamp(24px, 4vw, 48px);
    background:
        radial-gradient(ellipse 80% 50% at 100% 0%, rgba(37, 99, 235, 0.06), transparent),
        var(--auth-bg);
}

.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: clamp(24px, 4vh, 48px);
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--auth-border);
    background: var(--auth-card);
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.auth-back:hover {
    color: var(--auth-primary);
    border-color: rgba(37, 99, 235, 0.3);
    background: var(--auth-primary-light);
}

.auth-mobile-brand {
    display: none;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--auth-text);
    text-decoration: none;
    font-size: 1.1rem;
}

.auth-mobile-brand .auth-brand-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
    background: var(--auth-gradient);
    border: none;
}

.auth-form-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.auth-card {
    width: 100%;
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    padding: clamp(28px, 4vw, 40px);
    box-shadow: var(--auth-shadow);
}

.auth-card-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-card-header h1 {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--auth-text);
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.auth-card-header p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 14px;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 13px;
    margin-bottom: 22px;
    line-height: 1.7;
}

.auth-alert i {
    margin-top: 2px;
    flex-shrink: 0;
}

.auth-alert ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-field {
    margin-bottom: 20px;
}

.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--auth-text-soft);
    margin-bottom: 8px;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap > i.field-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-muted);
    font-size: 15px;
    pointer-events: none;
}

.auth-input {
    width: 100%;
    padding: 13px 44px 13px 16px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    font-family: var(--auth-font);
    font-size: 14px;
    color: var(--auth-text);
    background: var(--auth-bg);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: #fff;
}

.auth-input::placeholder {
    color: #94a3b8;
}

.auth-input[dir="ltr"] {
    text-align: left;
    direction: ltr;
}

.auth-toggle-pw {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--auth-muted);
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 15px;
    transition: color 0.2s, background 0.2s;
}

.auth-toggle-pw:hover {
    color: var(--auth-primary);
    background: var(--auth-primary-light);
}

.auth-toggle-pw:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
}

.auth-submit {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-family: var(--auth-font);
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: var(--auth-gradient);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.28);
    cursor: pointer;
    transition: box-shadow 0.2s, opacity 0.2s;
    margin-top: 8px;
}

.auth-submit:hover {
    box-shadow: 0 14px 36px rgba(37, 99, 235, 0.36);
}

.auth-submit:focus-visible {
    outline: 2px solid var(--auth-primary-dark);
    outline-offset: 2px;
}

.auth-submit:active {
    opacity: 0.92;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 28px 0 22px;
    color: var(--auth-muted);
    font-size: 12px;
    font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

.auth-demo-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--auth-muted);
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.auth-demo-grid {
    display: grid;
    gap: 10px;
}

.auth-demo-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: var(--auth-bg);
    font-family: var(--auth-font);
    font-size: 13px;
    color: var(--auth-text-soft);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    text-align: right;
}

.auth-demo-btn:hover {
    border-color: rgba(37, 99, 235, 0.35);
    background: var(--auth-primary-light);
    color: var(--auth-primary-dark);
}

.auth-demo-btn:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
}

.auth-demo-btn strong {
    font-weight: 700;
    color: var(--auth-text);
}

.auth-demo-btn code {
    font-size: 11px;
    color: var(--auth-muted);
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 8px;
    border-radius: 6px;
    direction: ltr;
}

.auth-demo-btn i {
    color: var(--auth-primary);
    font-size: 14px;
    flex-shrink: 0;
}

.auth-footer-note {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: var(--auth-muted);
}

.auth-footer-note code {
    background: var(--auth-bg);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    direction: ltr;
}

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

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

.auth-input--password {
    padding-left: 44px;
}

.field-error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #dc2626;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 960px) {
    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-showcase {
        display: none;
    }

    .auth-mobile-brand {
        display: inline-flex;
    }

    .auth-main {
        min-height: 100vh;
        min-height: 100dvh;
    }
}

@media (max-width: 480px) {
    .auth-main {
        padding: 16px;
    }

    .auth-card {
        padding: 24px 20px;
        box-shadow: var(--auth-shadow-sm, 0 8px 24px rgba(15, 23, 42, 0.08));
    }

    .auth-topbar {
        margin-bottom: 20px;
    }
}
