/**
 * ═══════════════════════════════════════════════════════════════════════════
 * NAMAZMAN LOGIN PAGE - MODERN CSS
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════════════════════════════════════════
   CSS VARIABLES
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* Primary Palette — Deep Ocean Blues */
    --primary-900: #0a1628;
    --primary-800: #0f2744;
    --primary-700: #143860;
    --primary-600: #1a4a7c;
    --primary-500: #1e5c99;
    --primary-400: #3d7ab8;
    --primary-300: #6b9dd0;
    --primary-200: #a3c4e5;
    --primary-100: #d1e2f2;

    /* Accent — Sacred Gold */
    --gold-500: #d4a853;
    --gold-400: #e5be6a;
    --gold-300: #f0d48f;
    --gold-glow: rgba(212, 168, 83, 0.3);

    /* Accent — Spiritual Teal */
    --teal-500: #2dd4bf;
    --teal-400: #5eead4;
    --teal-glow: rgba(45, 212, 191, 0.2);

    /* Semantic Colors */
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --error: #f43f5e;
    --error-light: rgba(244, 63, 94, 0.1);
    --warning: #f59e0b;

    /* Neutrals */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Gradients */
    --gradient-bg: linear-gradient(135deg, var(--primary-900) 0%, var(--primary-700) 50%, var(--primary-800) 100%);
    --gradient-gold: linear-gradient(135deg, var(--gold-500), var(--gold-400));
    --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.95) 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 40px var(--gold-glow);

    /* Typography */
    --font-family: 'IRANYekanXFaNum', system-ui, -apple-system, sans-serif;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-weight: 400;
    line-height: 1.6;
    color: var(--gray-700);
    background: var(--gradient-bg);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow-x: hidden;
}

::selection {
    background: var(--gold-500);
    color: var(--primary-900);
}

input:focus,
button:focus {
    outline: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BACKGROUND ELEMENTS
   ═══════════════════════════════════════════════════════════════════════════ */

.bg-gradient {
    position: fixed;
    inset: 0;
    background: var(--gradient-bg);
    z-index: -3;
}

.bg-pattern {
    position: fixed;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23d4a853' fill-opacity='1'%3E%3Cpath d='M40 0L20 20L0 0h40zM80 0L60 20L40 0h40zM40 40L20 60L0 40h40zM80 40L60 60L40 40h40zM40 80L20 60L40 40l20 20L40 80zM0 80l20-20L0 40v40zM80 80L60 60l20-20v40z'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -2;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: -1;
}

.bg-glow.glow-1 {
    width: 600px;
    height: 600px;
    top: -20%;
    right: -10%;
    background: var(--primary-500);
    opacity: 0.3;
}

.bg-glow.glow-2 {
    width: 500px;
    height: 500px;
    bottom: -15%;
    left: -10%;
    background: var(--gold-500);
    opacity: 0.15;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH CONTAINER
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-container {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BRAND
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-brand {
    text-align: center;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: transform var(--transition-fast);
}

.brand-link:hover {
    transform: scale(1.02);
}

.brand-icon {
    width: 52px;
    height: 52px;
    background: var(--gradient-gold);
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    color: var(--primary-900);
    box-shadow: var(--shadow-glow);
}

.brand-text {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.02em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH CARD
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-card {
    width: 100%;
    background: var(--gradient-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-gold);
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH STEPS
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-step {
    animation: fadeIn 0.4s ease-out;
}

.auth-step.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Step Header */
.step-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.btn-back {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    border: none;
    color: var(--gray-600);
    font-size: 1.1rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all var(--transition-fast);
}

.btn-back:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.step-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.75rem;
    color: var(--primary-600);
}

.step-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.step-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.step-desc {
    font-size: 0.95rem;
    color: var(--gray-500);
    line-height: 1.7;
}

.step-desc .highlight {
    color: var(--primary-600);
    font-weight: 600;
    direction: ltr;
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    right: 1rem;
    color: var(--gray-400);
    font-size: 1.1rem;
    pointer-events: none;
    transition: color var(--transition-fast);
}

.form-input {
    width: 100%;
    height: 52px;
    padding: 0 1rem 0 3rem;
    padding-right: 3rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    color: var(--gray-800);
    transition: all var(--transition-fast);
    text-align: center;
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input:hover {
    border-color: var(--gray-300);
}

.form-input:focus {
    border-color: var(--primary-500);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(30, 92, 153, 0.1);
}

.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary-500);
}

.form-input.error {
    border-color: var(--error);
    background: var(--error-light);
}

.form-input.error:focus {
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.1);
}

.form-error {
    font-size: 0.8rem;
    color: var(--error);
    min-height: 1.2em;
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════
   OTP INPUTS
   ═══════════════════════════════════════════════════════════════════════════ */

.otp-inputs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    direction: ltr;
}

.otp-input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-family: inherit;
}

.otp-input:hover {
    border-color: var(--gray-300);
}

.otp-input:focus {
    border-color: var(--primary-500);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(30, 92, 153, 0.1);
}

.otp-input.filled {
    border-color: var(--primary-400);
    background: var(--primary-100);
}

.otp-input.error {
    border-color: var(--error);
    background: var(--error-light);
    animation: shake 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* OTP Actions */
.otp-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.timer-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray-500);
}

.timer-wrapper i {
    font-size: 1rem;
}

.timer-wrapper.expired {
    display: none;
}

.btn-resend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--primary-600);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-resend:hover {
    background: var(--primary-100);
}

.btn-resend.hidden {
    display: none;
}

.btn-resend i {
    font-size: 1rem;
}

/* Attempts Info */
.attempts-info {
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray-500);
    min-height: 1.2em;
}

.attempts-info.warning {
    color: var(--warning);
}

.attempts-info.error {
    color: var(--error);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SUBMIT BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */

.btn-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    height: 52px;
    padding: 0 1.5rem;
    background: var(--gradient-gold);
    border: none;
    border-radius: var(--radius-md);
    color: var(--primary-900);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px var(--gold-glow);
    overflow: hidden;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--gold-glow);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-submit .btn-text {
    transition: opacity var(--transition-fast);
}

.btn-submit .btn-loader {
    position: absolute;
    display: none;
}

.btn-submit .btn-icon {
    font-size: 1.1rem;
    transition: transform var(--transition-fast);
}

.btn-submit:hover:not(:disabled) .btn-icon {
    transform: translateX(-4px);
}

.btn-submit.loading .btn-text {
    opacity: 0;
}

.btn-submit.loading .btn-icon {
    opacity: 0;
}

.btn-submit.loading .btn-loader {
    display: block;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-900);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   BIRTHDATE SELECTS
   ═══════════════════════════════════════════════════════════════════════════ */

.birthdate-selects {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1.2fr;
    gap: 0.75rem;
    direction: rtl;
}

.birthdate-select {
    height: 52px;
    padding: 0 1rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--gray-800);
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    padding-left: 2.5rem;
}

.birthdate-select:hover {
    border-color: var(--gray-300);
}

.birthdate-select:focus {
    outline: none;
    border-color: var(--primary-500);
    background-color: var(--white);
    box-shadow: 0 0 0 4px rgba(30, 92, 153, 0.1);
}

.birthdate-select.error {
    border-color: var(--error);
    background-color: var(--error-light);
}

.birthdate-select option {
    background: var(--white);
    color: var(--gray-800);
    padding: 0.5rem;
}

.birthdate-select option:disabled {
    color: var(--gray-400);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BONUS BADGE
   ═══════════════════════════════════════════════════════════════════════════ */

.bonus-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--success-light), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    animation: pulse 2s infinite;
}

.bonus-badge i {
    font-size: 1.25rem;
    color: var(--success);
}

.bonus-badge span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--success);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.auth-footer p {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.auth-footer a {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.auth-footer a:hover {
    color: var(--primary-700);
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BACK TO HOME
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-back {
    text-align: center;
}

.auth-back a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.auth-back a:hover {
    color: var(--white);
}

.auth-back i {
    font-size: 1rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATION
   ═══════════════════════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(-20px);
    transition: all var(--transition-smooth);
    pointer-events: auto;
    min-width: 280px;
    max-width: 90vw;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-right: 4px solid var(--success);
}

.toast.error {
    border-right: 4px solid var(--error);
}

.toast-icon {
    font-size: 1.25rem;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon i {
    color: var(--error);
}

.toast.error .toast-icon i::before {
    content: "\F62A"; /* bi-x-circle-fill */
}

.toast-message {
    flex: 1;
    font-size: 0.95rem;
    color: var(--gray-700);
}

.toast-close {
    padding: 0.25rem;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1rem;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--gray-600);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    body {
        padding: 1rem;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .step-title {
        font-size: 1.35rem;
    }

    .otp-input {
        width: 42px;
        height: 50px;
        font-size: 1.3rem;
    }

    .brand-icon {
        width: 46px;
        height: 46px;
        font-size: 1.3rem;
    }

    .brand-text {
        font-size: 1.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}