/* ===== پایه ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Vazirmatn', var(--font-fa);
    color: var(--eset-ink);
    background: var(--eset-surface-alt);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== صفحه ===== */
.auth-page {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    min-height: 100vh;
}

/* ===== پنل برندینگ ===== */
.auth-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 3.5rem 4.5rem;
    background: linear-gradient(155deg, var(--eset-hero-from) 0%, var(--eset-hero-to) 45%, #1a4a56 100%);
    overflow: hidden;
    order: 2;
}

.auth-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 70% at 15% 90%, var(--eset-turquoise-glow) 0%, transparent 50%),
        radial-gradient(ellipse 60% 50% at 90% 10%, rgba(0, 180, 194, 0.18) 0%, transparent 45%);
    pointer-events: none;
}

/* شبکهٔ تزئینی */
.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 150, 161, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 150, 161, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 75%);
}

/* درخشش */
.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    animation: pulseGlow 8s ease-in-out infinite;
}

.hero-glow--1 {
    width: 320px;
    height: 320px;
    top: -80px;
    right: -60px;
    background: rgba(0, 150, 161, 0.25);
}

.hero-glow--2 {
    width: 240px;
    height: 240px;
    bottom: 10%;
    left: 5%;
    background: rgba(0, 180, 194, 0.15);
    animation-delay: -4s;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

/* اشکال شناور */
.hero-shapes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.hero-shape {
    position: absolute;
    border: 1px solid rgba(0, 150, 161, 0.18);
    animation: floatShape 14s var(--ease-out) infinite;
}

.hero-shape--1 {
    width: 140px; height: 140px; top: 10%; left: 6%;
    transform: rotate(45deg);
    background: rgba(0, 150, 161, 0.07);
    border-radius: var(--radius-md);
}

.hero-shape--2 {
    width: 70px; height: 70px; bottom: 28%; right: 12%;
    border-radius: 50%;
    background: rgba(0, 180, 194, 0.1);
    animation-delay: -3s;
}

.hero-shape--3 {
    width: 220px; height: 220px; top: 48%; left: 50%;
    transform: rotate(-12deg);
    background: linear-gradient(135deg, rgba(0, 150, 161, 0.12) 0%, transparent 65%);
    animation-delay: -6s;
}

.hero-shape--4 {
    width: 36px; height: 36px; top: 18%; right: 22%;
    transform: rotate(45deg);
    background: var(--eset-turquoise);
    opacity: 0.3;
    animation-delay: -2s;
}

.hero-shape--5 {
    width: 18px; height: 18px; bottom: 40%; left: 30%;
    border-radius: 50%;
    background: var(--eset-turquoise-light);
    opacity: 0.5;
    animation-delay: -8s;
}

@keyframes floatShape {
    0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
    50% { transform: translateY(-20px) rotate(calc(var(--rot, 0deg) + 6deg)); }
}

.hero-shape--1 { --rot: 45deg; }
.hero-shape--3 { --rot: -12deg; }
.hero-shape--4 { --rot: 45deg; }

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 440px;
    animation: fadeSlideUp 0.9s var(--ease-out) both;
}

.hero-logo {
    width: 168px;
    margin-bottom: 2.75rem;
    filter: drop-shadow(0 6px 24px rgba(0, 150, 161, 0.35));
}

.hero-logo img { width: 100%; height: auto; display: block; }

.hero-title {
    font-size: 2.15rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 0.85rem;
    transition: opacity 0.4s var(--ease-out);
}

.hero-tagline {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2.25rem;
    transition: opacity 0.4s var(--ease-out);
}

.hero-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 2.5rem;
}

.hero-features li {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.94rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-features li:last-child { border-bottom: none; }

.hero-features .icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 150, 161, 0.18);
    border: 1px solid rgba(0, 180, 194, 0.3);
    border-radius: var(--radius-sm);
    color: var(--eset-turquoise-light);
    backdrop-filter: blur(4px);
}

.hero-features .icon svg { width: 18px; height: 18px; }

/* آمار */
.hero-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.35rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 180, 194, 0.2);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
}

.hero-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    text-align: center;
    min-width: 0;
}

.hero-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--eset-turquoise-light);
    line-height: 1.2;
    white-space: nowrap;
}

.hero-stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.35;
}

.hero-stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

/* ===== پنل فرم ===== */
.auth-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1.75rem;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 150, 161, 0.06) 0%, transparent 60%),
        var(--eset-surface);
    position: relative;
    order: 1;
}

.auth-form-panel::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--eset-border) 15%, var(--eset-border) 85%, transparent);
}

.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 2rem 2.25rem 1.75rem;
    background: var(--eset-surface);
    border: 1px solid rgba(216, 226, 232, 0.8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    position: relative;
    animation: fadeSlideUp 0.75s var(--ease-out) 0.05s both;
    overflow: hidden;
}

/* نوار بالای کارت */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--eset-turquoise-dark), var(--eset-turquoise), var(--eset-turquoise-light));
}

.auth-card-header { margin-bottom: 1.75rem; }

.auth-card-header .mobile-logo {
    display: none;
    width: 130px;
    margin: 0 auto 1.25rem;
}

/* تب‌ها */
.auth-tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    padding: 0.35rem;
    background: var(--eset-surface-alt);
    border-radius: var(--radius-lg);
    margin-bottom: 1.75rem;
    border: 1px solid var(--eset-border);
}

.auth-tab {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--eset-ink-muted);
    background: transparent;
    border: none;
    border-radius: calc(var(--radius-lg) - 4px);
    cursor: pointer;
    transition: color var(--duration) var(--ease-out);
}

.auth-tab svg { width: 18px; height: 18px; flex-shrink: 0; }

.auth-tab.is-active { color: #fff; }

.auth-tab:not(.is-active):hover { color: var(--eset-turquoise); }

.auth-tab-indicator {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: calc(50% - 0.35rem);
    height: calc(100% - 0.7rem);
    background: linear-gradient(135deg, var(--eset-turquoise-light), var(--eset-turquoise));
    border-radius: calc(var(--radius-lg) - 4px);
    box-shadow: 0 4px 14px rgba(0, 150, 161, 0.35);
    transition: transform 0.4s var(--ease-spring);
    pointer-events: none;
}

.auth-header-text { text-align: center; }

.auth-header-text h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--eset-ink);
    margin-bottom: 0.4rem;
    transition: opacity 0.3s;
}

.auth-header-text p {
    font-size: 0.9rem;
    color: var(--eset-ink-muted);
    transition: opacity 0.3s;
}

/* پنل‌های فرم */
.auth-panels { position: relative; min-height: 0; }

.auth-panel {
    display: none;
    animation: panelIn 0.45s var(--ease-out) both;
}

.auth-panel.is-active { display: block; }

@keyframes panelIn {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== فرم ===== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--eset-ink-soft);
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap .input-icon {
    position: absolute;
    right: 0.95rem;
    display: flex;
    color: var(--eset-ink-muted);
    pointer-events: none;
    transition: color var(--duration) var(--ease-out);
}

.input-wrap .input-icon svg { width: 19px; height: 19px; }

.form-control {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.85rem;
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--eset-ink);
    background: var(--eset-surface-alt);
    border: 1.5px solid var(--eset-border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--duration), background var(--duration), box-shadow var(--duration);
}

.form-control[dir="ltr"] { text-align: left; }

.form-control::placeholder { color: #a8b5bd; }

.form-control:hover {
    border-color: #b5c5cd;
    background: #fff;
}

.form-control:focus {
    border-color: var(--eset-border-focus);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 150, 161, 0.11);
}

.input-wrap:focus-within .input-icon { color: var(--eset-turquoise); }

.toggle-password {
    position: absolute;
    left: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--eset-ink-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color var(--duration), background var(--duration);
}

.toggle-password:hover {
    color: var(--eset-turquoise);
    background: var(--eset-turquoise-pale);
}

.toggle-password svg { width: 19px; height: 19px; }

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row--2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.form-row--2col .form-group { margin: 0; }

/* قدرت رمز */
.password-strength {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.35rem;
}

.password-strength-bar {
    flex: 1;
    height: 4px;
    background: var(--eset-border);
    border-radius: 4px;
    overflow: hidden;
}

.password-strength-bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 4px;
    background: var(--eset-border);
    transition: width 0.35s var(--ease-out), background 0.35s;
}

.password-strength-bar span.is-weak { background: #ef4444; }
.password-strength-bar span.is-fair { background: #f59e0b; }
.password-strength-bar span.is-good { background: #0096a1; }
.password-strength-bar span.is-strong { background: #059669; }

.password-strength-label {
    font-size: 0.75rem;
    color: var(--eset-ink-muted);
    min-width: 2.5rem;
}

/* چک‌باکس */
.checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrap--terms { margin-top: 0.15rem; }

.checkbox-wrap input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border: 1.5px solid var(--eset-border);
    border-radius: 5px;
    background: var(--eset-surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration) var(--ease-out);
    flex-shrink: 0;
}

.checkbox-wrap input:checked + .checkbox-custom {
    background: var(--eset-turquoise);
    border-color: var(--eset-turquoise);
}

.checkbox-wrap input:checked + .checkbox-custom::after {
    content: '';
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

.checkbox-wrap input:focus-visible + .checkbox-custom {
    box-shadow: 0 0 0 3px rgba(0, 150, 161, 0.2);
}

.checkbox-label {
    font-size: 0.84rem;
    color: var(--eset-ink-soft);
    line-height: 1.5;
}

.link-muted,
.link-inline {
    color: var(--eset-turquoise);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.84rem;
    transition: color var(--duration);
}

.link-muted:hover,
.link-inline:hover {
    color: var(--eset-turquoise-dark);
    text-decoration: underline;
}

/* دکمه */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.95rem 1.5rem;
    margin-top: 0.35rem;
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--eset-turquoise-light) 0%, var(--eset-turquoise) 55%, var(--eset-turquoise-dark) 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    transition: transform var(--duration) var(--ease-out), box-shadow var(--duration);
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 55%);
    opacity: 0;
    transition: opacity var(--duration);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(0, 150, 161, 0.38);
}

.btn-primary:hover::after { opacity: 1; }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.btn-primary .btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-primary.is-loading .btn-text { opacity: 0; }
.btn-primary.is-loading .btn-spinner { display: block; position: absolute; }
.btn-primary svg { width: 19px; height: 19px; }

@keyframes spin { to { transform: rotate(360deg); } }

.auth-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--eset-border);
    text-align: center;
    font-size: 0.78rem;
    color: var(--eset-ink-muted);
}

/* پیام */
.alert {
    display: none;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
    font-size: 0.84rem;
    animation: fadeSlideUp 0.35s var(--ease-out);
}

.alert.is-visible { display: flex; }

.alert-icon { flex-shrink: 0; width: 17px; height: 17px; margin-top: 2px; }

.alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert--success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert--success .alert-icon { color: #059669; }

/* انیمیشن */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* واکنش‌گرا */
@media (max-width: 1024px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-hero { display: none; }

    .auth-form-panel {
        min-height: 100vh;
        padding: 1.5rem 1rem;
        background: linear-gradient(180deg, var(--eset-surface-alt) 0%, var(--eset-surface) 25%);
    }

    .auth-form-panel::after { display: none; }

    .auth-card {
        max-width: 480px;
        padding: 1.75rem 1.5rem 1.5rem;
        box-shadow: var(--shadow-soft);
    }

    .auth-card-header .mobile-logo { display: block; }
}

@media (max-width: 480px) {
    .form-row--2col { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; align-items: flex-start; }
    .auth-card { padding: 1.5rem 1.15rem; border-radius: var(--radius-lg); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--eset-turquoise);
    outline-offset: 2px;
}
