﻿
/* ═══════════════════════════════════════════════════════════════════
                       Auth Page - Modern Design
                       ═══════════════════════════════════════════════════════════════════ */
/* YekanBakh Font */
@font-face {
    font-family: 'YekanBakh';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('/fonts/YekanBakh/YekanBakhFaNum-Light-1.woff2') format('woff2');
}

@font-face {
    font-family: 'YekanBakh';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/YekanBakh/YekanBakhFaNum-Regular-1.woff2') format('woff2');
}

@font-face {
    font-family: 'YekanBakh';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/YekanBakh/YekanBakhFaNum-SemiBold.woff2') format('woff2');
}

@font-face {
    font-family: 'YekanBakh';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/YekanBakh/YekanBakhFaNum-ExtraBold-1.woff2') format('woff2');
}

:root {
    --auth-primary: #667eea;
    --auth-primary-dark: #5a67d8;
    --auth-secondary: #764ba2;
    --auth-accent: #f093fb;
    --auth-text: #1a202c;
    --auth-text-muted: #5a6478;
    --auth-link: #5a67d8;
    --auth-danger: #c53030;
    --auth-bg: #f7fafc;
    --auth-card: #ffffff;
    --auth-border: #e2e8f0;
    --auth-input-bg: #f8fafc;
    --auth-input-focus: #ffffff;
    --auth-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --auth-glow: rgba(102, 126, 234, 0.3);
}

[data-theme="dark"] {
    --auth-text: #e2e8f0;
    --auth-text-muted: #a0aec0;
    --auth-link: #a5b4fc;
    --auth-danger: #fc8181;
    --auth-bg: #0f1724;
    --auth-card: rgba(30, 41, 59, 0.8);
    --auth-border: rgba(255, 255, 255, 0.08);
    --auth-input-bg: rgba(255, 255, 255, 0.05);
    --auth-input-focus: rgba(255, 255, 255, 0.08);
    --auth-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --auth-glow: rgba(102, 126, 234, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.auth-page {
    font-family: 'YekanBakh', 'Vazirmatn', Tahoma, sans-serif;
    min-height: 100vh;
    background: var(--auth-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

    /* Animated Background */
    body.auth-page::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: radial-gradient(ellipse at 20% 50%, rgba(102, 126, 234, 0.15) 0%, transparent 50%), radial-gradient(ellipse at 80% 20%, rgba(118, 75, 162, 0.12) 0%, transparent 50%), radial-gradient(ellipse at 40% 80%, rgba(240, 147, 251, 0.1) 0%, transparent 50%);
        z-index: 0;
        animation: bgPulse 15s ease-in-out infinite;
    }

[data-theme="dark"] body.auth-page::before {
    background: radial-gradient(ellipse at 20% 50%, rgba(102, 126, 234, 0.08) 0%, transparent 50%), radial-gradient(ellipse at 80% 20%, rgba(118, 75, 162, 0.06) 0%, transparent 50%), radial-gradient(ellipse at 40% 80%, rgba(240, 147, 251, 0.05) 0%, transparent 50%);
}

@keyframes bgPulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Floating Shapes */
.auth-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.auth-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    animation: float 20s ease-in-out infinite;
}

    .auth-shape:nth-child(1) {
        width: 300px;
        height: 300px;
        background: var(--auth-primary);
        top: -100px;
        right: -50px;
        animation-delay: 0s;
    }

    .auth-shape:nth-child(2) {
        width: 200px;
        height: 200px;
        background: var(--auth-secondary);
        bottom: -50px;
        left: -50px;
        animation-delay: -5s;
    }

    .auth-shape:nth-child(3) {
        width: 150px;
        height: 150px;
        background: var(--auth-accent);
        top: 50%;
        left: 10%;
        animation-delay: -10s;
    }

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(20px, -20px) rotate(5deg);
    }

    50% {
        transform: translate(-10px, 10px) rotate(-3deg);
    }

    75% {
        transform: translate(15px, 5px) rotate(3deg);
    }
}

/* Login Container */
.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    animation: slideUp 0.6s ease-out;
}

    .auth-container.register-mode {
        max-width: 640px;
    }

@media (max-width: 576px) {
    .auth-container,
    .auth-container.register-mode {
        max-width: 100%;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Card */
.auth-card {
    background: var(--auth-card);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--auth-border);
    box-shadow: var(--auth-shadow);
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .auth-card {
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
}

[data-theme="dark"] .auth-validation-summary {
    background: rgba(229, 62, 62, 0.15);
    border-color: rgba(229, 62, 62, 0.3);
    color: #fc8181;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--auth-primary), var(--auth-secondary), var(--auth-accent));
}

/* Logo */
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

    .auth-logo img {
        height: 64px;
        margin-bottom: 16px;
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    }

    .auth-logo h1 {
        font-family: 'Vazirmatn', Tahoma, sans-serif;
        font-size: 1.5rem;
        font-weight: 800;
        color: var(--auth-text);
        margin-bottom: 8px;
    }

    .auth-logo p {
        font-size: 0.9rem;
        color: var(--auth-text-muted);
    }

/* Form */
.auth-form {
    width: 100%;
}

/* Row Layout for Register Form */
.auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 4px;
}

@media (max-width: 576px) {
    .auth-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Input Group */
.auth-input-group {
    margin-bottom: 20px;
    position: relative;
}

    .auth-input-group label {
        display: block;
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--auth-text);
        margin-bottom: 8px;
    }

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

.auth-input-icon {
    position: absolute;
    right: 16px;
    width: 20px;
    height: 20px;
    color: var(--auth-text-muted);
    transition: color 0.3s ease;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-input {
    width: 100%;
    padding: 14px 48px 14px 16px;
    font-family: 'YekanBakh', 'Vazirmatn', Tahoma, sans-serif;
    font-size: 0.95rem;
    color: var(--auth-text);
    background: var(--auth-input-bg);
    border: 2px solid var(--auth-border);
    border-radius: 14px;
    outline: none;
    transition: all 0.3s ease;
    direction: ltr;
    text-align: left;
}

/* اینپوت‌های متنیِ فارسی (نام/نام خانوادگی): راست‌چین */
.auth-input.auth-input-rtl {
    direction: rtl;
    text-align: right;
}

    .auth-input::placeholder {
        color: var(--auth-text-muted);
        opacity: 1;
    }

    .auth-input:focus {
        border-color: var(--auth-primary);
        background: var(--auth-input-focus);
        box-shadow: 0 0 0 4px var(--auth-glow);
    }

        .auth-input:focus + .auth-input-icon,
        .auth-input:focus ~ .auth-input-icon {
            color: var(--auth-primary);
        }

/* Password Toggle */
.auth-password-toggle {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    color: var(--auth-text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
}

    .auth-password-toggle:hover {
        color: var(--auth-primary);
    }

/* رمز چپ‌چین است ولی چشم سمتِ چپ می‌نشیند → پدینگ تا کاراکترها زیرِ چشم نروند.
   به دکمهٔ چشم وصل شده (نه type) چون با نمایشِ رمز type عوض می‌شود */
.auth-input:has(~ .auth-password-toggle) {
    padding-left: 50px;
}

/* Validation */
.auth-input-validation-error {
    border-color: var(--auth-danger) !important;
    background-color: rgba(229, 62, 62, 0.05) !important;
}

    .auth-input-validation-error:focus {
        box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.15) !important;
    }

.auth-validation-message {
    color: var(--auth-danger);
    font-size: 0.8rem;
    margin-top: 6px;
    display: block;
}

/* Captcha */
.auth-captcha {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--auth-input-bg);
    border-radius: 14px;
    border: 1px solid var(--auth-border);
    overflow: hidden;
}

    .auth-captcha label {
        display: block;
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--auth-text);
        margin-bottom: 12px;
    }

    .auth-captcha .dntCaptcha {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    /* مخفی کردن br احتمالی خروجی DNTCaptcha تا چیدمان یک‌خطی نشکند */
    .auth-captcha .dntCaptcha > br {
        display: none;
    }

    /* باکس اینپوت کپتچا: فضای باقی‌مانده سطر را بگیرد تا عکس و اینپوت کنار هم باشند.
       mb-3 بعضی صفحات هم حذف شود تا وسط‌چینی flex به‌هم نریزد */
    .auth-captcha .dntCaptcha > .fv-row {
        flex: 1 1 140px;
        min-width: 0;
        margin-bottom: 0 !important;
    }

    .auth-captcha .dntCaptcha > .fv-row .auth-input {
        width: 100%;
    }

    /* پیام خطای کپتچا همیشه تمام‌عرض سطر بعد */
    .auth-captcha .dntCaptcha .auth-validation-message {
        flex-basis: 100%;
    }

    .auth-captcha #dntCaptchaImg {
        width: 176px;
        height: 60px;
        object-fit: contain;
        display: block;
        border-radius: 8px;
        margin-bottom: 0 !important;
        flex-shrink: 0;
    }

    .auth-captcha .fv-row {
        overflow: hidden;
    }

.auth-captcha-refresh {
    font-size: 20px;
    color: var(--auth-text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 10px;
    background: var(--auth-input-bg);
    /*border: 1px solid var(--auth-border);*/
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

    .auth-captcha-refresh:hover {
        color: var(--auth-primary);
        transform: rotate(45deg);
        border-color: var(--auth-primary);
    }

/* Links */
.auth-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 0.85rem;
}

.auth-link {
    color: var(--auth-link);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

    .auth-link:hover {
        color: var(--auth-primary-dark);
        text-decoration: underline;
    }

/* Verification Code Inputs */
.auth-code-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
    direction: ltr;
}

.auth-code-input {
    width: 52px;
    height: 60px;
    text-align: center;
    font-family: 'YekanBakh', 'Vazirmatn', Tahoma, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--auth-text);
    background: var(--auth-input-bg);
    border: 2px solid var(--auth-border);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    padding: 0;
}

    .auth-code-input:focus {
        border-color: var(--auth-primary);
        background: var(--auth-input-focus);
        box-shadow: 0 0 0 4px var(--auth-glow);
        transform: scale(1.05);
    }

    .auth-code-input.auth-input-validation-error {
        border-color: #e53e3e !important;
        background-color: rgba(229, 62, 62, 0.05) !important;
    }

@media (max-width: 480px) {
    .auth-code-input {
        width: 44px;
        height: 52px;
        font-size: 1.25rem;
    }

    .auth-code-group {
        gap: 6px;
    }
}

/* Submit Button */
.auth-submit {
    width: 100%;
    padding: 16px;
    font-family: 'YekanBakh', 'Vazirmatn', Tahoma, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, var(--auth-primary-dark), var(--auth-secondary));
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .auth-submit::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        transition: left 0.5s ease;
    }

    .auth-submit:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    }

        .auth-submit:hover::before {
            left: 100%;
        }

    .auth-submit:active {
        transform: translateY(0);
    }

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    gap: 12px;
}

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

    .auth-divider span {
        font-size: 0.8rem;
        color: var(--auth-text-muted);
        white-space: nowrap;
    }

/* Register Link */
.auth-register {
    text-align: center;
    font-size: 0.9rem;
    color: var(--auth-text-muted);
}

    .auth-register a {
        color: var(--auth-link);
        text-decoration: none;
        font-weight: 700;
        transition: color 0.3s ease;
    }

        .auth-register a:hover {
            color: var(--auth-primary-dark);
            text-decoration: underline;
        }

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--auth-border);
}

.auth-footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

.auth-footer-link {
    font-size: 0.8rem;
    color: var(--auth-text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

    .auth-footer-link:hover {
        color: var(--auth-primary);
    }

.auth-footer-contact {
    font-size: 0.8rem;
    color: var(--auth-text-muted);
}

    .auth-footer-contact a {
        color: var(--auth-link);
        text-decoration: none;
        font-weight: 500;
    }

/* Theme Toggle */
.auth-theme-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--auth-text);
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

    .auth-theme-toggle:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    }

/* Back to Home */
.auth-back-home {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
    color: var(--auth-text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

    .auth-back-home:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
        color: var(--auth-primary);
    }

/* Responsive */
@media (max-width: 576px) {
    .auth-card {
        padding: 32px 20px;
        border-radius: 20px;
    }

    .auth-logo h1 {
        font-size: 1.25rem;
    }

    .auth-back-home {
        top: auto;
        bottom: 20px;
        right: 50%;
        transform: translateX(50%);
    }

    .auth-theme-toggle {
        top: auto;
        bottom: 20px;
        left: 20px;
    }

    .auth-captcha {
        padding: 12px;
    }

        .auth-captcha .dntCaptcha {
            flex-direction: column;
            align-items: flex-start;
        }

        .auth-captcha #dntCaptchaImg {
            max-width: 100%;
        }
}

/* Validation Summary */
.auth-validation-summary {
    background: rgba(229, 62, 62, 0.08);
    border: 1px solid rgba(229, 62, 62, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: var(--auth-danger);
    font-size: 0.85rem;
    display: none;
}

    .auth-validation-summary.visible {
        display: block;
        animation: shake 0.5s ease;
    }

    .auth-validation-summary ul {
        margin: 0;
        padding-right: 20px;
        list-style-type: disc;
    }

        .auth-validation-summary ul li {
            margin-bottom: 4px;
        }

            .auth-validation-summary ul li:last-child {
                margin-bottom: 0;
            }

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-5px);
    }

    40% {
        transform: translateX(5px);
    }

    60% {
        transform: translateX(-5px);
    }

    80% {
        transform: translateX(5px);
    }
}

