﻿/* auth.css
 ==========================================================================
   طلای شهریور | ورود / ثبت‌نام — Auth page styles
   ========================================================================== */

:root {
    --bg: #F2EEDD;
    --bg-soft: #F7F0E7;
    --bg-section: #F2E7D8;
    --surface: #FFFFFF;
    --gold: #D4AF37;
    --gold-light: #E6C867;
    --gold-dark: #9F7A17;
    --cyan: #0099D6;
    --text: #1A2433;
    --ink-dim: #56606B;
    --ink-faint: #7A8592;
    --line: rgba(212,175,55,.22);
    --navy-deep: #241A0C;
    --shadow-sm: 0 8px 24px rgba(0,0,0,.05);
    --shadow-md: 0 20px 60px rgba(0,0,0,.08);
    --shadow-lg: 0 30px 90px rgba(0,0,0,.14);
    --radius: 18px;
    --ease: cubic-bezier(.16,.8,.24,1);
    --danger: #c0442f;
    --success: #2f8f5b;
    --header-offset: 30px;
    --font-primary: "Vazirmatn", sans-serif;
    --font-display: "Zain", sans-serif;
    --font-serif: "Libre Caslon Text", serif;
    --fs-xs: 0.75rem; /* 12px */
    --fs-sm: 0.875rem; /* 14px */
    --fs-base: 1rem; /* 16px */
    --fs-lg: 1.125rem; /* 18px */
    --fs-xl: 1.25rem; /* 20px */
    --fs-2xl: 1.5rem; /* 24px */
    --fs-3xl: 1.875rem; /* 30px */
    --fs-4xl: 2.25rem; /* 36px */
}

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

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

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

h1, h2, h3 {
    margin: 0;
    font-weight: 700;
    font-family: var(--font-primary);
}

p {
    margin: 0;
}

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 4px;
}

.logo-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.cls-1 {
    fill: url(#blueGrad);
    stroke-width: 0;
}

.cls-2 {
    fill: url(#goldGrad);
    stroke-width: 0;
}

/* ---------- Shell ---------- */
/* auth-wrap now flows normally between the site header and footer
   instead of forcing a standalone full-viewport page — it just
   reserves --header-offset at the top so nothing sits behind the
   fixed header, and fills at least the remaining viewport height. */
.auth-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: calc(100vh - var(--header-offset));
    margin-top: var(--header-offset);
    width: 100%;
    background: radial-gradient(circle at top left,#FFFDF9 0%,transparent 35%), radial-gradient(circle at bottom right,#F6E9D7 0%,transparent 40%), linear-gradient(180deg,#FCF8F3,#F7F0E7);
    color: var(--text);
    font-family: var(--font-primary);
    line-height: 1.75;
}

@media (max-width:900px) {
    .auth-wrap {
        grid-template-columns: 1fr;
    }
}

/* ---------- Visual side ---------- */
.auth-visual {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    background: linear-gradient(165deg,#F7EFDF 0%,#E8D2A4 55%,#D8BC85 100%);
    color: #2B2110;
}

@media (max-width:900px) {
    .auth-visual {
        min-height: 260px;
        padding: 32px 24px;
    }
}

.auth-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(420px 260px at 85% 15%, rgba(255,255,255,.35), transparent 60%), radial-gradient(500px 320px at 10% 100%, rgba(36,26,12,.18), transparent 60%);
    pointer-events: none;
}

.auth-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: var(--fs-base);
}

.auth-visual-body {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

    .auth-visual-body .eyebrow {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-size: var(--fs-xs);
        letter-spacing: .28em;
        font-weight: 600;
        color: #6B4E12;
        text-transform: uppercase;
        margin-bottom: 18px;
    }

        .auth-visual-body .eyebrow::before {
            content: '';
            width: 18px;
            height: 1px;
            background: #6B4E12;
            display: inline-block;
        }

    .auth-visual-body h2 {
        font-size: clamp(24px,3vw,34px);
        line-height: 1.45;
    }

    .auth-visual-body p {
        margin-top: 14px;
        font-size: var(--fs-sm);
        color: rgba(43,33,16,.78);
    }

.auth-ring {
    position: relative;
    z-index: 1;
    align-self: flex-end;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 12px solid rgba(159,122,23,.55);
    box-shadow: inset 0 0 20px rgba(230,200,103,.6);
}

@media (max-width:900px) {
    .auth-ring {
        display: none;
    }
}

.auth-quote {
    position: relative;
    z-index: 1;
    margin-top: 36px;
    padding-top: 18px;
    border-top: 1px solid rgba(36,26,12,.2);
    font-size: var(--fs-xs);
    color: rgba(43,33,16,.68);
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

/* ---------- Form side ---------- */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

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

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-xs);
    color: var(--ink-faint);
    margin-bottom: 28px;
}

    .auth-back:hover {
        color: var(--gold-dark);
    }

    .auth-back svg {
        width: 14px;
        height: 14px;
    }

/* Tabs */
.auth-tabs {
    display: flex;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px;
    margin-bottom: 32px;
}

.auth-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--ink-dim);
    font-size: var(--fs-sm);
    font-weight: 600;
    padding: 11px 14px;
    border-radius: 999px;
    text-align: center;
    transition: background .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}

    .auth-tab.active {
        background: linear-gradient(135deg,#F7D766,var(--gold),#A97C13);
        color: #fff;
        box-shadow: 0 10px 24px rgba(212,175,55,.3);
    }

/* Forms */
.auth-form {
    display: none;
}

    .auth-form.active {
        display: block;
        animation: authFade .4s var(--ease);
    }

@keyframes authFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form h1 {
    font-size: var(--fs-2xl);
    margin-bottom: 8px;
}

.auth-form > p.sub {
    color: var(--ink-dim);
    font-size: var(--fs-sm);
    margin-bottom: 28px;
}

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

    .auth-field label {
        display: block;
        font-size: var(--fs-xs);
        color: var(--ink-dim);
        margin-bottom: 8px;
    }

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}

    .auth-input-wrap:focus-within {
        border-color: var(--gold);
        box-shadow: 0 0 0 3px rgba(212,175,55,.12);
    }

    .auth-input-wrap svg.field-icon {
        width: 17px;
        height: 17px;
        color: var(--ink-faint);
        margin-inline-start: 14px;
        flex-shrink: 0;
    }

    .auth-input-wrap input {
        flex: 1;
        min-width: 0;
        background: transparent;
        border: none;
        outline: none;
        padding: 13px 14px;
        font-family: inherit;
        font-size: var(--fs-sm);
        color: var(--text);
    }

        .auth-input-wrap input::placeholder {
            color: rgba(122,133,146,.6);
        }

.field-toggle {
    background: none;
    border: none;
    color: var(--ink-faint);
    padding: 0 14px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

    .field-toggle:hover {
        color: var(--gold-dark);
    }

    .field-toggle svg {
        width: 18px;
        height: 18px;
    }

.field-error {
    font-size: var(--fs-xs);
    color: var(--danger);
    margin-top: 7px;
}

    .field-error:empty {
        display: none;
    }

.auth-field.has-error .auth-input-wrap {
    border-color: rgba(192,68,47,.55);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: var(--fs-xs);
    gap: 10px;
    flex-wrap: wrap;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-dim);
}

    .auth-check label {
        margin: 0;
        cursor: pointer;
    }

    .auth-check input {
        accent-color: var(--gold);
        width: 15px;
        height: 15px;
        margin: 0;
    }

.auth-link {
    color: var(--cyan);
    font-size: var(--fs-xs);
}

    .auth-link:hover {
        text-decoration: underline;
    }

.auth-submit {
    position: relative;
    overflow: hidden;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 999px;
    font-size: var(--fs-sm);
    font-weight: 600;
    border: none;
    color: #fff;
    background: linear-gradient(135deg,#F7D766,var(--gold),#A97C13);
    box-shadow: 0 10px 30px rgba(212,175,55,.28);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), opacity .2s;
}

    .auth-submit:hover {
        transform: translateY(-2px);
        box-shadow: 0 18px 40px rgba(212,175,55,.35);
    }

    .auth-submit:active {
        transform: scale(.98);
    }

    .auth-submit:disabled {
        opacity: .7;
        cursor: progress;
        transform: none;
    }

    .auth-submit .spinner {
        width: 16px;
        height: 16px;
        border-radius: 50%;
        border: 2px solid rgba(255,255,255,.4);
        border-top-color: #fff;
        display: none;
        animation: spin .7s linear infinite;
    }

    .auth-submit.loading .spinner {
        display: inline-block;
    }

    .auth-submit.loading .submit-label {
        opacity: .85;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 26px 0;
    color: var(--ink-faint);
    font-size: var(--fs-xs);
}

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

.auth-switch {
    text-align: center;
    font-size: var(--fs-xs);
    color: var(--ink-dim);
}

    .auth-switch a {
        color: var(--gold-dark);
        font-weight: 600;
        font-size: var(--fs-xs);
    }

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

/* Alert toast */
.auth-alert {
    position: fixed;
    bottom: 24px;
    inset-inline-end: 24px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: var(--shadow-lg);
    font-size: var(--fs-xs);
    color: var(--text);
    transform: translateY(140%);
    opacity: 0;
    transition: transform .4s var(--ease), opacity .4s var(--ease);
    max-width: 320px;
}

    .auth-alert.show {
        transform: translateY(0);
        opacity: 1;
    }

    .auth-alert.success {
        border-color: rgba(47,143,91,.4);
    }

        .auth-alert.success svg {
            color: var(--success);
        }

    .auth-alert.error {
        border-color: rgba(192,68,47,.4);
    }

        .auth-alert.error svg {
            color: var(--danger);
        }

    .auth-alert svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
