/* Authentication Pages Dark Theme Support */

/* Root Variables for Light Theme */
:root {
    --auth-brand-red: #D7263D;
    --auth-brand-red-dark: #b81e32;
    --auth-brand-blue: #3498DB;
    --auth-brand-blue-dark: #2477ad;
    --auth-brand-gray: #6C757D;
    --auth-brand-bg: #F5F7FB;
    --auth-text-dark: #1A1F36;
    --auth-text-muted: #6C757D;
    --auth-card-bg: #fff;
    --auth-card-border: rgba(26, 31, 54, 0.06);
    --auth-card-shadow: 0 24px 60px -28px rgba(26, 31, 54, 0.35);
    --auth-input-bg: #ffffff;
    --auth-input-border: #d1d5db;
    --auth-section-bg: #f8f9fc;
    --auth-section-border: #e2e8f0;
    --auth-icon-muted: #aab2c4;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --auth-brand-bg: #1a1a1a;
    --auth-text-dark: #e0e0e0;
    --auth-text-muted: #9aa3b5;
    --auth-card-bg: #2d2d2d;
    --auth-card-border: rgba(255, 255, 255, 0.07);
    --auth-card-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.7);
    --auth-input-bg: #26282f;
    --auth-input-border: #404040;
    --auth-section-bg: #26282f;
    --auth-section-border: #3a3d46;
    --auth-icon-muted: #6b7280;
}

/* Auth Pages Specific Styles */
.login-wrapper,
.register-wrapper {
    background: var(--auth-brand-bg);
    color: var(--auth-text-dark);
}

.auth-card {
    background: var(--auth-card-bg);
}

[data-theme="dark"] .auth-card {
    box-shadow: 0 10px 40px -15px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .login-wrapper,
[data-theme="dark"] .register-wrapper {
    background: var(--auth-brand-bg);
}

[data-theme="dark"] .card {
    background: var(--auth-card-bg);
}

[data-theme="dark"] .card-body {
    color: var(--auth-text-dark);
}

[data-theme="dark"] label.form-label {
    color: var(--text-secondary);
}

[data-theme="dark"] .form-control {
    background-color: var(--bg-tertiary);
    border-color: var(--auth-input-border);
    color: var(--auth-text-dark);
}

[data-theme="dark"] .form-control:focus {
    background-color: var(--bg-tertiary);
    border-color: var(--auth-brand-blue);
    color: var(--auth-text-dark);
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted);
}

[data-theme="dark"] .link-row a {
    color: var(--auth-brand-blue);
}

[data-theme="dark"] .link-row a:hover {
    color: var(--auth-brand-red);
}

[data-theme="dark"] .form-check-label {
    color: var(--auth-text-dark);
}

/* ============================================================
   Modern Auth Design System
   (Login / Register / ForgotPassword / VerifyCode)
   ============================================================ */

body {
    background: var(--auth-brand-bg);
    background-image:
        radial-gradient(620px 320px at 88% -6%, rgba(215, 38, 61, 0.07), transparent 70%),
        radial-gradient(620px 320px at 8% 106%, rgba(52, 152, 219, 0.09), transparent 70%);
    background-attachment: fixed;
    font-family: "IRANSans", "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
    color: var(--auth-text-dark);
}

[data-theme="dark"] body {
    background: var(--auth-brand-bg);
    background-image:
        radial-gradient(620px 320px at 88% -6%, rgba(215, 38, 61, 0.1), transparent 70%),
        radial-gradient(620px 320px at 8% 106%, rgba(52, 152, 219, 0.08), transparent 70%);
    background-attachment: fixed;
}

/* --- Shell & card --- */
.auth-shell {
    width: 100%;
    max-width: 440px;
    margin-inline: auto;
    padding: 96px 0.5rem 2.5rem;
}

.auth-shell--wide {
    max-width: 480px;
}

.auth-card {
    position: relative;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    border-radius: 22px;
    box-shadow: var(--auth-card-shadow);
    padding: 2.5rem 2.25rem 2rem;
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--auth-brand-red), var(--auth-brand-blue));
}

/* --- Header (badge + titles) --- */
.auth-head {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-badge {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--auth-brand-red), var(--auth-brand-red-dark));
    color: #fff;
    font-size: 1.45rem;
    box-shadow: 0 14px 28px -12px rgba(215, 38, 61, 0.55);
}

.auth-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0 0 0.4rem;
    color: var(--auth-text-dark);
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--auth-text-muted);
    line-height: 1.9;
    margin: 0;
}

/* --- Form fields --- */
.auth-field {
    margin-bottom: 1.15rem;
}

.auth-field .form-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--auth-text-muted);
    margin-bottom: 0.4rem;
}

.auth-input {
    position: relative;
}

.auth-input > .form-control {
    border-radius: 12px;
    border: 1.5px solid var(--auth-input-border);
    background: var(--auth-input-bg);
    color: var(--auth-text-dark);
    padding: 0.78rem 2.8rem 0.78rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input > .form-control:focus {
    border-color: var(--auth-brand-blue);
    box-shadow: 0 0 0 0.18rem rgba(52, 152, 219, 0.18);
    background: var(--auth-input-bg);
    color: var(--auth-text-dark);
}

.auth-input > .auth-icon {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    color: var(--auth-icon-muted);
    pointer-events: none;
    transition: color 0.2s ease;
}

.auth-input > .form-control:focus ~ .auth-icon {
    color: var(--auth-brand-blue);
}

/* Password fields: room for the visibility toggle */
.auth-input--password > .form-control {
    padding-left: 2.9rem;
}

.auth-eye {
    position: absolute;
    top: 50%;
    left: 0.5rem;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--auth-icon-muted);
    transition: color 0.2s ease, background-color 0.2s ease;
}

.auth-eye:hover {
    color: var(--auth-brand-blue);
    background: rgba(52, 152, 219, 0.1);
}

/* One-time code input */
.auth-input.auth-code > .form-control {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.55rem;
    direction: ltr;
    padding: 0.6rem 1rem;
}

/* --- Remember me / inline link row --- */
.auth-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.15rem;
    font-size: 0.9rem;
}

.auth-meta .form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
}

.auth-meta .form-check-input {
    float: none;
    margin: 0;
    flex-shrink: 0;
    width: 1.05rem;
    height: 1.05rem;
    border: 1.5px solid var(--auth-input-border);
    cursor: pointer;
}

.auth-meta .form-check-input:checked {
    background-color: var(--auth-brand-red);
    border-color: var(--auth-brand-red);
}

.auth-meta .form-check-label {
    color: var(--auth-text-dark);
    cursor: pointer;
}

.auth-meta a {
    color: var(--auth-brand-blue);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s ease;
}

.auth-meta a:hover {
    color: var(--auth-brand-red);
}

.auth-meta a i {
    font-size: 0.8rem;
}

/* --- Captcha --- */
.auth-captcha {
    background: var(--auth-section-bg);
    border: 1px solid var(--auth-section-border);
    border-radius: 14px;
    padding: 0.9rem;
    margin-bottom: 1.25rem;
}

.auth-mini-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--auth-text-muted);
    margin-bottom: 0.65rem;
}

.auth-mini-label i {
    color: var(--auth-brand-blue);
}

.auth-captcha-row {
    display: flex;
    align-items: stretch;
    gap: 0.6rem;
}

.auth-captcha-img {
    height: 48px;
    border-radius: 10px;
    border: 1px solid var(--auth-section-border);
    background: #fff;
    flex-shrink: 0;
}

.auth-captcha-refresh {
    width: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--auth-section-border);
    border-radius: 10px;
    background: var(--auth-input-bg);
    color: var(--auth-brand-blue);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.auth-captcha-refresh i {
    transition: transform 0.45s ease;
}

.auth-captcha-refresh:hover {
    color: var(--auth-brand-red);
    border-color: var(--auth-brand-blue);
}

.auth-captcha-refresh:hover i {
    transform: rotate(180deg);
}

.auth-captcha-refresh:disabled {
    opacity: 0.6;
}

.auth-captcha-row .form-control {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-weight: 700;
    letter-spacing: 2px;
    border-radius: 10px;
    border: 1.5px solid var(--auth-input-border);
    background: var(--auth-input-bg);
    color: var(--auth-text-dark);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-captcha-row .form-control:focus {
    border-color: var(--auth-brand-blue);
    box-shadow: 0 0 0 0.18rem rgba(52, 152, 219, 0.18);
    background: var(--auth-input-bg);
    color: var(--auth-text-dark);
}

/* --- Buttons --- */
.auth-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--auth-brand-red) 0%, var(--auth-brand-red-dark) 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 14px 26px -12px rgba(215, 38, 61, 0.6);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
    text-decoration: none;
}

.auth-btn:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 18px 32px -14px rgba(215, 38, 61, 0.65);
    filter: brightness(1.05);
}

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

.auth-btn--blue {
    background: linear-gradient(135deg, var(--auth-brand-blue) 0%, var(--auth-brand-blue-dark) 100%);
    box-shadow: 0 14px 26px -12px rgba(52, 152, 219, 0.6);
}

.auth-btn--blue:hover {
    box-shadow: 0 18px 32px -14px rgba(52, 152, 219, 0.65);
}

/* --- Footer links --- */
.auth-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.15rem;
    border-top: 1px dashed var(--auth-section-border);
    font-size: 0.9rem;
}

.auth-links--center {
    justify-content: center;
}

.auth-links .hint {
    color: var(--auth-text-muted);
}

.auth-links a {
    color: var(--auth-brand-blue);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s ease;
}

.auth-links a:hover {
    color: var(--auth-brand-red);
}

.auth-links a i {
    font-size: 0.85rem;
}

/* --- Validation --- */
.auth-alert.validation-summary-errors {
    background: rgba(215, 38, 61, 0.07);
    border: 1px solid rgba(215, 38, 61, 0.3);
    color: var(--auth-brand-red);
    border-radius: 12px;
    padding: 0.7rem 1rem;
    font-size: 0.87rem;
    font-weight: 600;
    margin-bottom: 1.15rem;
}

.auth-alert.validation-summary-errors ul {
    margin: 0;
    padding: 0 1.1rem 0 0;
}

.auth-alert.validation-summary-valid {
    display: none;
}

.auth-card .field-validation-error {
    display: block;
    color: var(--auth-brand-red);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.35rem;
}

/* --- Register page info blocks --- */
.auth-note {
    background: var(--auth-section-bg);
    border: 1px solid var(--auth-section-border);
    border-radius: 14px;
    padding: 1.4rem 1.2rem;
    text-align: center;
    margin-bottom: 1.25rem;
}

.auth-note p {
    margin: 0;
    font-size: 1rem;
    line-height: 2;
    color: var(--auth-text-dark);
}

.auth-note strong {
    color: var(--auth-brand-red);
}

.auth-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-section-border);
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
}

.auth-phone i {
    color: var(--auth-brand-blue);
    font-size: 1.2rem;
}

.auth-phone a {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--auth-brand-red);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-phone a:hover {
    color: var(--auth-brand-red-dark);
}

.auth-contact {
    margin-bottom: 1.5rem;
}

/* --- Responsive --- */
@media (max-width: 575.98px) {
    .auth-shell {
        padding-top: 84px;
    }

    .auth-card {
        padding: 1.9rem 1.4rem 1.6rem;
        border-radius: 18px;
    }

    .auth-badge {
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
        border-radius: 16px;
    }

    .auth-title {
        font-size: 1.2rem;
    }

    .auth-captcha-img,
    .auth-captcha-refresh {
        height: 44px;
        width: auto;
    }

    .auth-captcha-refresh {
        width: 44px;
    }
}
