@font-face { font-family: 'Vazirmatn'; src: url('/assets/fonts/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/assets/fonts/Vazirmatn-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/assets/fonts/Vazirmatn-Black.woff2') format('woff2'); font-weight: 900; font-display: swap; }

:root {
    --brand: #FFD700;
    --brand-2: #FFA500;
    --brand-3: #FF8C00;
    --brand-rgb: 255, 215, 0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    color: #1f2937;
    -webkit-font-smoothing: antialiased;
}
[x-cloak] { display: none !important; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-20px); } }
@keyframes gradientShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseGold { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.05); opacity: 1; } }
@keyframes pulseTimer { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

/* ═══ Layout ═══ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 50%, #fef9e7 100%);
}
.auth-background {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(var(--brand-rgb), 0.06) 0%,
        rgba(255,255,255,0.02) 50%,
        rgba(var(--brand-rgb), 0.06) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    pointer-events: none;
    z-index: 0;
}
.particle-floating {
    position: absolute;
    border-radius: 50%;
    background: var(--brand);
    pointer-events: none;
    animation: float 6s ease-in-out infinite;
    opacity: 0.5;
}

/* ═══ LEFT PANEL ═══ */
.left-panel {
    display: none;
    width: 50%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 50%, var(--brand-3) 100%);
    background-size: 200% 200%;
    animation: gradientShift 12s ease infinite;
}
.left-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 40%, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 50px 50px, 80px 80px, 100px 100px;
    pointer-events: none;
}
.left-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 3rem;
    color: #fff;
    width: 100%;
    min-height: 100vh;
}
.float-circle {
    position: absolute;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    backdrop-filter: blur(8px);
    animation: float 6s ease-in-out infinite;
}
.logo-container { margin-bottom: 2.5rem; }
.logo-inner {
    width: 8rem; height: 8rem;
    background: rgba(255,255,255,0.25);
    border-radius: 1.75rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    font-size: 3.5rem;
    font-weight: 900;
    color: #fff;
    overflow: hidden;
    animation: pulseGold 3s ease-in-out infinite;
}
.logo-inner img { width: 100%; height: 100%; object-fit: cover; }
.left-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    line-height: 1.15;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.left-title .accent {
    display: block;
    font-size: 4rem;
    color: #fff8d6;
    margin-top: 0.25rem;
}
.left-subtitle {
    font-size: 1.4rem;
    color: rgba(255,255,255,0.95);
    max-width: 32rem;
    line-height: 1.6;
    margin-bottom: 3rem;
}
.features-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    max-width: 28rem;
}
.feature-item {
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    text-align: right;
    transition: transform 0.3s ease;
}
.feature-item:hover { transform: translateX(-8px); }
.feature-icon {
    width: 3.5rem; height: 3.5rem;
    background: rgba(255,255,255,0.25);
    border-radius: 1rem;
    display: flex; align-items: center; justify-content: center;
    margin-left: 1rem;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}
.feature-item:hover .feature-icon {
    background: rgba(255,255,255,0.4);
    transform: scale(1.08);
}
.feature-icon svg { width: 1.75rem; height: 1.75rem; color: #fff; }
.feature-text { color: #fff; font-size: 1.15rem; font-weight: 600; flex: 1; }

/* ═══ RIGHT PANEL ═══ */
.right-panel {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    z-index: 10;
    min-height: 100vh;
}
.form-wrapper {
    width: 100%;
    max-width: 30rem;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.lang-selector {
    display: flex;
    gap: 0.25rem;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 0.25rem;
    width: fit-content;
    margin-right: auto;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
}
[dir="ltr"] .lang-selector { margin-right: 0; margin-left: auto; }
.lang-selector a {
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    color: #6b7280;
    transition: all 0.15s;
    white-space: nowrap;
}
.lang-selector a:hover { background: rgba(var(--brand-rgb), 0.15); color: #92400e; }
.lang-selector a.active {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
}

.form-card {
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow:
        0 20px 25px -5px rgba(0,0,0,0.08),
        0 10px 10px -5px rgba(0,0,0,0.04),
        0 0 0 1px rgba(var(--brand-rgb), 0.05);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.form-card:hover {
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════
   AUTH TOGGLE — تب ورود / ثبت‌نام
   ═══════════════════════════════════════════════════════════ */
.auth-toggle {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: linear-gradient(to bottom, #f3f4f6, #ffffff);
    border-radius: 1.25rem;
    box-shadow: inset 0 2px 4px 0 rgba(0,0,0,0.06);
    margin-bottom: 1.25rem;
}
.auth-toggle button {
    flex: 1;
    padding: 0.9rem 1rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 1rem;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.auth-toggle button svg { width: 1.25rem; height: 1.25rem; color: currentColor; }
.auth-toggle button.active {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    font-weight: 800;
    box-shadow:
        0 4px 6px -1px rgba(var(--brand-rgb), 0.35),
        0 2px 4px -1px rgba(var(--brand-rgb), 0.25);
    transform: scale(1.02);
}
.auth-toggle button.active svg { color: #fff; }
.auth-toggle button:not(.active):hover {
    background: rgba(var(--brand-rgb), 0.1);
    color: var(--brand-3);
}

/* ═══════════════════════════════════════════════════════════
   METHOD TOGGLE — تب کد تایید / رمز عبور
   ═══════════════════════════════════════════════════════════ */
.login-method-toggle { margin-bottom: 1.25rem; }

.toggle-container {
    position: relative;
    display: flex;
    background: linear-gradient(to bottom, #f3f4f6, #ffffff);
    border-radius: 1.25rem;
    padding: 0.5rem;
    box-shadow: inset 0 2px 4px 0 rgba(0,0,0,0.06);
    overflow: hidden;
}
.toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.toggle-option {
    flex: 1;
    padding: 0.9rem 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 1rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    z-index: 2;
    color: #6b7280;
    position: relative;
    user-select: none;
}
.toggle-option svg { width: 1.15rem; height: 1.15rem; flex-shrink: 0; color: currentColor; }
.toggle-option:hover { color: var(--brand-3); }

.toggle-slider {
    position: absolute;
    top: 0.5rem;
    bottom: 0.5rem;
    right: 0.5rem;
    width: calc(50% - 0.5rem);
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border-radius: 1rem;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow:
        0 4px 6px -1px rgba(var(--brand-rgb), 0.35),
        0 2px 4px -1px rgba(var(--brand-rgb), 0.25);
    z-index: 1;
}
#login_method_password:checked ~ .toggle-slider {
    transform: translateX(calc(-100% - 0.5rem));
}
#login_method_otp:checked ~ .toggle-option-left,
#login_method_password:checked ~ .toggle-option-right {
    color: #fff;
    font-weight: 800;
}

/* ═══ FORM GROUP ═══ */
.form-group { position: relative; margin-bottom: 1.25rem; }
.input-wrapper { position: relative; }

.form-input {
    width: 100%;
    padding: 1.1rem 3.5rem 1.1rem 1.25rem;
    background: linear-gradient(to bottom, #f9fafb, #fff);
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    font-size: 1rem;
    color: #111827;
    font-family: inherit;
    outline: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
}
.form-input::placeholder { color: transparent; }
.form-input:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow:
        0 0 0 4px rgba(var(--brand-rgb), 0.1),
        0 10px 15px -3px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.input-label {
    position: absolute;
    right: 3.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 1rem;
    font-weight: 500;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: #fff;
    padding: 0 0.5rem;
    z-index: 1;
}
.form-input:focus + .input-label,
.form-input:not(:placeholder-shown) + .input-label {
    transform: translateY(-32px) scale(0.85);
    color: var(--brand-3);
    font-weight: 700;
}

.input-icon-right {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    width: 1.5rem; height: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
    transition: all 0.3s;
    z-index: 2;
}
.input-icon-right svg { width: 100%; height: 100%; }
.form-input:focus ~ .input-icon-right {
    color: var(--brand);
    transform: translateY(-50%) scale(1.15);
}

.toggle-password {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    width: 2.25rem;
    height: 2.25rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.25s ease;
    z-index: 3;
    padding: 0;
}
.toggle-password:hover {
    color: var(--brand-3);
    background: rgba(var(--brand-rgb), 0.12);
    transform: translateY(-50%) scale(1.1);
}
.toggle-password svg { width: 1.25rem; height: 1.25rem; }

/* ═══ OTP ═══ */
.otp-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.75rem;
}
.otp-send-btn {
    flex: 1;
    padding: 0.95rem 1.25rem;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border: 2px solid #e5e7eb;
    border-radius: 0.875rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    color: #1f2937;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.otp-send-btn svg {
    width: 1.15rem; height: 1.15rem;
    flex-shrink: 0;
    color: var(--brand-3);
    transition: transform 0.3s ease;
}
.otp-send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(var(--brand-rgb), 0.1) 0%, rgba(var(--brand-rgb), 0.05) 100%);
    border-color: var(--brand);
    color: #92400e;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(var(--brand-rgb), 0.2);
}
.otp-send-btn:hover:not(:disabled) svg { transform: translateX(-3px) scale(1.1); }
.otp-send-btn:disabled { opacity: 0.55; cursor: not-allowed; background: #f3f4f6; }

.otp-timer {
    font-size: 0.85rem;
    font-weight: 700;
    color: #92400e;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, rgba(var(--brand-rgb), 0.12) 0%, rgba(var(--brand-rgb), 0.06) 100%);
    border: 2px solid rgba(var(--brand-rgb), 0.3);
    border-radius: 0.875rem;
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
    animation: pulseTimer 2s ease-in-out infinite;
}

/* ═══ INFO BADGE ═══ */
.info-badge {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    background: rgba(var(--brand-rgb), 0.08);
    border: 1px solid rgba(var(--brand-rgb), 0.25);
    border-radius: 0.75rem;
    font-size: 0.85rem;
    color: #92400e;
    margin-bottom: 1.25rem;
    line-height: 1.5;
    font-weight: 500;
}
.info-badge svg {
    width: 1.15rem; height: 1.15rem;
    flex-shrink: 0;
    color: var(--brand-3);
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════
   SUBMIT BUTTON — دکمه ورود
   ═══════════════════════════════════════════════════════════ */
.btn-submit {
    position: relative;
    width: 100%;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 50%, var(--brand) 100%);
    background-size: 200% 100%;
    color: #ffffff;
    font-family: inherit;
    font-weight: 800;
    font-size: 1.1rem;
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow:
        0 10px 15px -3px rgba(var(--brand-rgb), 0.35),
        0 4px 6px -2px rgba(var(--brand-rgb), 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 50%, var(--brand-2) 100%);
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: inherit;
}
.btn-submit > * { position: relative; z-index: 1; }
.btn-submit:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.01);
    box-shadow:
        0 20px 25px -5px rgba(var(--brand-rgb), 0.45),
        0 10px 10px -5px rgba(var(--brand-rgb), 0.25);
}
.btn-submit:hover:not(:disabled)::before { opacity: 1; }
.btn-submit:active:not(:disabled) { transform: translateY(-1px) scale(0.99); }
.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}
.btn-submit svg { width: 1.35rem; height: 1.35rem; flex-shrink: 0; }

/* ═══ SPINNER ═══ */
.spinner {
    width: 1.35rem;
    height: 1.35rem;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

/* ═══ FOOTER — حساب کاربری ندارید؟ ═══ */
.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.form-footer a {
    color: var(--brand-3);
    text-decoration: none;
    font-weight: 800;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}
.form-footer a:hover {
    background: rgba(var(--brand-rgb), 0.1);
    color: #92400e;
}

/* ═══ ALERTS ═══ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    font-weight: 600;
}
.alert svg { width: 1.15rem; height: 1.15rem; flex-shrink: 0; margin-top: 2px; }
.alert-error { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); color: #dc2626; }
.alert-success { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); color: #059669; }

/* ═══ POWERED BY ═══ */
.powered-by {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: #9ca3af;
}
.powered-by a {
    color: #6b7280;
    text-decoration: none;
    font-weight: 600;
}
.powered-by a:hover { color: var(--brand-3); }

/* ═══ RESPONSIVE ═══ */
@media (min-width: 1024px) {
    .left-panel { display: flex; }
    .right-panel { width: 50%; }
}
@media (max-width: 640px) {
    .right-panel { padding: 1rem; align-items: flex-start; padding-top: 1.5rem; }
    .form-card { padding: 1.75rem 1.25rem; border-radius: 1.25rem; }
    .left-title { font-size: 2rem; }
    .lang-selector a { padding: 0.35rem 0.6rem; font-size: 0.7rem; }
    .form-input { padding: 1rem 3rem 1rem 1rem; font-size: 0.95rem; }
    .input-label { right: 3rem; font-size: 0.9rem; }
    .toggle-option { font-size: 0.78rem; padding: 0.7rem 0.5rem; }
    .toggle-option svg { width: 1rem; height: 1rem; }
    .otp-actions { flex-direction: column; align-items: stretch; }
    .otp-timer { text-align: center; }
    .btn-submit { padding: 1.1rem 1.5rem; font-size: 1rem; }
}
