/* ============================================
   Login Page — Clean + Beautiful Field Animations
   ============================================ */

@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; }

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

/* ============ Animations (Minimal) ============ */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes iconPop {
    0% { transform: translateY(-50%) scale(1); }
    40% { transform: translateY(-50%) scale(1.15) rotate(-5deg); }
    100% { transform: translateY(-50%) scale(1.15) rotate(0deg); }
}
@keyframes highlightSlide {
    from { width: 0; opacity: 0; }
    to { width: 100%; opacity: 1; }
}

/* ============ Layout ============ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

/* LEFT PANEL */
.left-panel {
    display: none;
    width: 50%;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
    position: relative;
    overflow: hidden;
}
.left-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 3rem;
    color: white;
    width: 100%;
    min-height: 100vh;
}

.logo-container { margin-bottom: 2.5rem; }
.logo-inner {
    width: 8rem;
    height: 8rem;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}
.logo-inner i { font-size: 4rem; color: white; }

.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: #fef3c7;
}
.left-subtitle {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.95);
    max-width: 32rem;
    line-height: 1.6;
    margin-bottom: 3rem;
}

/* Features */
.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;
    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;
    transition: all 0.3s ease;
}
.feature-item:hover .feature-icon {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.08);
}
.feature-icon i { font-size: 1.25rem; color: white; }
.feature-text {
    color: white;
    font-size: 1.15rem;
    font-weight: 600;
    flex: 1;
    text-align: right;
}

/* RIGHT PANEL */
.right-panel {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: #f9fafb;
    min-height: 100vh;
}
.form-wrapper {
    width: 100%;
    max-width: 30rem;
}

/* Language selector */
.lang-selector {
    display: flex;
    justify-content: flex-end;
    gap: .25rem;
    background: white;
    border-radius: .75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: .25rem;
    width: fit-content;
    margin-left: auto;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
}
.lang-selector a {
    padding: .4rem .8rem;
    border-radius: .5rem;
    font-size: .75rem;
    font-weight: 700;
    text-decoration: none;
    color: #6b7280;
    transition: all .15s;
    white-space: nowrap;
}
.lang-selector a:hover { background: #fef3c7; color: #92400e; }
.lang-selector a.active { background: #FFD700; color: #78350f; }

/* Form card */
.form-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* Tabs */
.auth-toggle {
    display: flex;
    gap: .5rem;
    padding: .35rem;
    background: #f3f4f6;
    border-radius: .875rem;
    margin-bottom: 1.5rem;
}
.auth-toggle button {
    flex: 1;
    padding: .75rem 1rem;
    font-weight: 600;
    font-size: .9rem;
    border-radius: .625rem;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-family: inherit;
    transition: all .25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}
.auth-toggle button.active {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 165, 0, 0.3);
}
.auth-toggle button:not(.active):hover {
    background: rgba(255, 215, 0, 0.15);
    color: #b45309;
}

/* Method toggle */
.method-toggle { margin-bottom: 1.25rem; }
.method-container {
    display: flex;
    background: #f3f4f6;
    border-radius: .75rem;
    padding: .3rem;
    gap: .25rem;
}
.method-option {
    flex: 1;
    padding: .65rem .5rem;
    text-align: center;
    font-weight: 600;
    font-size: .85rem;
    border-radius: .5rem;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-family: inherit;
    transition: all .25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}
.method-option.active {
    background: white;
    color: #b45309;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-weight: 700;
}
.method-option:not(.active):hover { color: #92400e; }

/* ============================================
   FORM GROUPS — Beautiful Hover/Focus Animations
   ============================================ */
.form-group {
    position: relative;
    margin-bottom: 1.25rem;
    --highlight-color: #FFD700;
}

.form-input {
    width: 100%;
    padding: 1rem 3.25rem 1rem 1.25rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: .875rem;
    font-size: .95rem;
    color: #111827;
    font-family: inherit;
    outline: none;
    display: block;
    position: relative;
    z-index: 2;
    background: transparent;
    transition: border-color .3s ease, box-shadow .3s ease;
}
.form-input::placeholder { color: transparent; }

/* Hover effect — subtle border glow */
.form-group:hover .form-input {
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.08);
}

/* Focus effect — strong highlight */
.form-input:focus {
    border-color: #FFD700;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.15);
}

/* Floating label */
.input-label {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: .95rem;
    font-weight: 500;
    pointer-events: none;
    transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 .5rem;
    z-index: 3;
    background: white;
}
.form-group:hover .input-label {
    color: #b45309;
}
.form-input:focus + .input-label,
.form-input:not(:placeholder-shown) + .input-label {
    transform: translateY(-32px) scale(.85);
    color: #d97706;
    font-weight: 700;
}

/* Icon — hover pop effect */
.input-icon-wrapper {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    z-index: 3;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: color .3s ease;
}
.form-group:hover .input-icon-wrapper { color: #fbbf24; }
.form-input:focus ~ .input-icon-wrapper {
    color: #d97706;
    animation: iconPop 0.4s ease forwards;
}

/* Bottom highlight bar (animated) */
.form-group::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
    border-radius: 0 0 .875rem .875rem;
    z-index: 4;
    transition: width .4s cubic-bezier(0.4, 0, 0.2, 1);
}
.form-input:focus ~ .form-group::after,
.form-group:has(.form-input:focus)::after {
    width: 100%;
}

/* Password toggle */
.password-toggle-btn {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    background: none;
    border: none;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    transition: color .2s;
}
.password-toggle-btn:hover { color: #d97706; }

/* OTP input */
.otp-input {
    letter-spacing: 0.5em;
    text-align: center;
    direction: ltr;
    font-weight: 700;
    font-size: 1.1rem;
}

/* OTP actions */
.otp-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.otp-send-btn {
    flex: 1;
    padding: .65rem 1rem;
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
    border-radius: .75rem;
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}
.otp-send-btn:hover:not(:disabled) {
    background: rgba(255, 215, 0, 0.15);
    border-color: #FFD700;
    color: #b45309;
}
.otp-send-btn:disabled { opacity: .6; cursor: not-allowed; }
.otp-timer {
    font-size: .85rem;
    font-weight: 700;
    color: #6b7280;
    min-width: 70px;
    text-align: center;
}

/* Button */
.btn-primary {
    width: 100%;
    padding: 1.05rem 2rem;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: .875rem;
    cursor: pointer;
    transition: all .25s ease;
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin-top: 1.25rem;
    position: relative;
    overflow: hidden;
}
.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #FFA500 0%, #FFD700 100%);
    opacity: 0;
    transition: opacity .3s ease;
}
.btn-primary > * { position: relative; z-index: 1; }
.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(255, 165, 0, 0.4);
}
.btn-primary:hover:not(:disabled)::before { opacity: 1; }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

/* Info badge */
.info-badge {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .5rem;
    padding: .75rem 1rem;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: .75rem;
    font-size: .8rem;
    color: #92400e;
}

/* Messages */
.message-box {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
    padding: .75rem 1rem;
    border-radius: .75rem;
    font-size: .875rem;
    animation: slideUp 0.3s ease;
}
.message-error { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.2); color: #dc2626; }
.message-success { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.2); color: #059669; }

/* Footer */
.form-footer-text {
    text-align: center;
    font-size: .85rem;
    color: #6b7280;
    margin-top: 1.25rem;
}
.form-link { color: #6b7280; text-decoration: none; transition: color .2s; }
.form-link:hover { color: #d97706; }
.form-link.gold {
    color: #d97706;
    font-weight: 700;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: .85rem;
}
.form-link.gold:hover { text-decoration: underline; }

.back-link { text-align: center; margin-top: 1.5rem; }
.back-link a {
    color: #6b7280;
    text-decoration: none;
    font-size: .9rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    transition: color .2s;
}
.back-link a:hover { color: #d97706; }

/* Utilities */
.flex-1 { flex: 1; }
.text-xs { font-size: .75rem; }
.font-bold { font-weight: 700; }
.font-mono { font-family: monospace; }
.mt-3 { margin-top: .75rem; }

/* Dashboard */
.dash-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f9fafb; padding: 2rem; }
.dash-box { background: white; border-radius: 1.5rem; padding: 2.5rem; max-width: 32rem; width: 100%; text-align: center; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
.dash-icon { width: 5rem; height: 5rem; margin: 0 auto 1.5rem; background: linear-gradient(135deg, #fbbf24, #d97706); border-radius: 1.5rem; display: flex; align-items: center; justify-content: center; }
.dash-icon i { color: white; font-size: 2.25rem; }
.dash-title { font-size: 1.875rem; font-weight: 900; margin-bottom: .75rem; color: #1f2937; }
.dash-sub { color: #6b7280; margin-bottom: 1.5rem; }
.dash-info { background: #f0fdf4; border: 2px solid #bbf7d0; border-radius: .75rem; padding: 1rem; margin-bottom: 1.5rem; text-align: right; }
.dash-role { font-weight: 700; color: #166534; margin-bottom: .5rem; }
.dash-line { font-size: .75rem; color: #15803d; }
.dash-actions { display: flex; gap: .5rem; justify-content: center; }
.dash-btn-secondary { padding: .75rem 1.5rem; background: #f3f4f6; color: #374151; border-radius: .75rem; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; }
.dash-btn-danger { padding: .75rem 1.5rem; background: #ef4444; color: white; border-radius: .75rem; font-weight: 700; border: none; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: .5rem; }

/* ============ Responsive ============ */
@media (min-width: 1024px) {
    .left-panel { display: flex; }
    .right-panel { width: 50%; }
}
@media (min-width: 640px) {
    .form-card { padding: 2.5rem; }
    .right-panel { padding: 2rem; }
}
@media (min-width: 1024px) {
    .form-card { padding: 3rem; }
}
