/* Local utility styles for login page (replaces Tailwind CDN) */

.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.hidden { display: none; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.me-2 { margin-inline-end: 0.5rem; }

.w-full { width: 100%; }
.w-20 { width: 5rem; }
.h-20 { height: 5rem; }
.h-px { height: 1px; }
.max-w-md { max-width: 28rem; }

.p-4 { padding: 1rem; }
.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

.m-0 { margin: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1\.5 { margin-bottom: 0.375rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }

.relative { position: relative; }
.absolute { position: absolute; }
.top-1\/2 { top: 50%; }
.left-4 { left: 1rem; }
.right-4 { right: 1rem; }
.-translate-y-1\/2 { transform: translateY(-50%); }

.block { display: block; }
.text-center { text-align: center; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-white { color: #fff; }
.text-blue-100 { color: #dbeafe; }
.text-blue-600 { color: #2563eb; }
.text-blue-700 { color: #1d4ed8; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-700 { color: #374151; }
.text-red-700 { color: #b91c1c; }
.text-amber-800 { color: #92400e; }

.bg-white { background-color: #fff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-red-100 { background-color: #fee2e2; }
.bg-amber-100 { background-color: #fef3c7; }
.bg-blue-600 { background-color: #2563eb; }
.bg-blue-50 { background-color: #eff6ff; }

.border { border-width: 1px; border-style: solid; }
.border-2 { border-width: 2px; border-style: solid; }
.border-gray-300 { border-color: #d1d5db; }
.border-red-400 { border-color: #f87171; }
.border-amber-400 { border-color: #fbbf24; }
.border-blue-200 { border-color: #bfdbfe; }
.border-blue-400 { border-color: #60a5fa; }

.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.shadow-blue-500\/30 {
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3), 0 4px 6px -4px rgba(59, 130, 246, 0.3);
}

.space-y-6 > * + * { margin-top: 1.5rem; }

.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.duration-300 { transition-duration: 300ms; }

.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }

.hover\:text-gray-600:hover { color: #4b5563; }
.hover\:text-blue-700:hover { color: #1d4ed8; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.hover\:bg-blue-50:hover { background-color: #eff6ff; }
.hover\:border-blue-400:hover { border-color: #60a5fa; }

.hover\:shadow-xl:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.active\:scale-\[0\.97\]:active { transform: scale(0.97); }

/* Brand + form fields */
.login-brand-name {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fff;
    margin: 0 0 0.35rem;
    text-transform: none;
}

.login-field {
    display: block;
}

.login-field-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.login-field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-field-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 1;
}

.login-field-wrap--rtl .login-field-icon--leading {
    inset-inline-end: 1rem;
}

.login-field-wrap--rtl .login-field-icon--trailing,
.login-field-wrap--rtl .login-field-toggle {
    inset-inline-start: 1rem;
}

.login-field-wrap--ltr .login-field-icon--leading {
    inset-inline-start: 1rem;
}

.login-field-wrap--ltr .login-field-icon--trailing,
.login-field-wrap--ltr .login-field-toggle {
    inset-inline-end: 1rem;
}

.login-field-input {
    width: 100%;
    padding: 0.9rem 1rem;
    padding-inline-start: 2.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #111827;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.login-field-input--password {
    padding-inline-end: 2.75rem;
}

.login-field-input::placeholder {
    color: #94a3b8;
}

.login-field-input:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.login-field-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}

.login-field-wrap:focus-within .login-field-icon--leading {
    color: #3b82f6;
}

.login-field-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #9ca3af;
    padding: 0.35rem;
    cursor: pointer;
    line-height: 1;
    border-radius: 0.5rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.login-field-toggle:hover {
    color: #4b5563;
    background: rgba(148, 163, 184, 0.12);
}

.login-field-toggle:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

html.theme-dark .login-field-label {
    color: #c9d1d9;
}

html.theme-dark .login-field-input {
    background: #161b22;
    border-color: #30363d;
    color: #e6edf3;
}

html.theme-dark .login-field-input::placeholder {
    color: #6e7681;
}

html.theme-dark .login-field-input:hover {
    border-color: #484f58;
    background: #1c2128;
}

html.theme-dark .login-field-input:focus {
    border-color: #58a6ff;
    background: #1c2128;
    box-shadow: 0 0 0 4px rgba(56, 139, 253, 0.2);
}

html.theme-dark .login-field-wrap:focus-within .login-field-icon--leading {
    color: #58a6ff;
}

/* ---- Auth shell v2 (split hero + form) ---- */

.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: 'Vazirmatn', system-ui, sans-serif;
    background: #0f172a;
}

.auth-toolbar {
    position: fixed;
    top: 16px;
    inset-inline-end: 16px;
    display: flex;
    gap: 8px;
    z-index: 20;
}

.auth-toolbar-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
}

.auth-layout {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
}

@media (min-width: 960px) {
    .auth-layout {
        grid-template-columns: 1.05fr 1fr;
    }
}

.auth-hero {
    position: relative;
    min-height: 220px;
    overflow: hidden;
    display: none;
}

@media (min-width: 960px) {
    .auth-hero {
        display: block;
        min-height: 100vh;
    }
}

.auth-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.auth-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.35) 0%, rgba(30, 58, 138, 0.72) 55%, rgba(15, 23, 42, 0.9) 100%);
}

.auth-hero-caption {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 2.5rem;
    color: #fff;
}

.auth-logo {
    display: block;
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 16px;
}

.auth-hero-brand {
    margin: 0 0 0.35rem;
    opacity: 0.9;
    font-weight: 700;
}

.auth-hero-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
}

.auth-hero-tagline {
    margin: 0.75rem 0 0;
    opacity: 0.9;
    max-width: 28rem;
    line-height: 1.6;
}

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

html.theme-dark .auth-main {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
}

.auth-main-inner {
    width: 100%;
    max-width: 28rem;
}

.auth-header {
    margin-bottom: 1rem;
}

.auth-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
}

html.theme-dark .auth-title {
    color: #e6edf3;
}

.auth-subtitle {
    margin: 0.5rem 0 0;
    color: #64748b;
    font-size: 0.95rem;
}

html.theme-dark .auth-subtitle {
    color: #8b949e;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 0.65rem 0.75rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: #475569;
    background: rgba(148, 163, 184, 0.15);
}

.auth-tab.is-active {
    color: #fff;
    background: #2563eb;
}

html.theme-dark .auth-tab {
    color: #c9d1d9;
    background: rgba(48, 54, 61, 0.8);
}

html.theme-dark .auth-tab.is-active {
    background: #1f6feb;
}

.auth-card {
    background: #fff;
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.18);
}

html.theme-dark .auth-card {
    background: #1c2128;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
}

.auth-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover {
    color: #1d4ed8;
}

html.theme-dark .auth-link {
    color: #58a6ff;
}

.auth-btn {
    width: 100%;
    border: 0;
    border-radius: 1rem;
    padding: 0.95rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s ease;
}

.auth-btn:active {
    transform: scale(0.98);
}

.auth-btn--primary {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 10px 25px -10px rgba(37, 99, 235, 0.8);
}

.auth-btn--primary:hover {
    background: #1d4ed8;
}

.auth-btn--primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.auth-btn--ghost {
    margin-top: 0.5rem;
    background: transparent;
    color: #475569;
    border: 1.5px solid #cbd5e1;
}

html.theme-dark .auth-btn--ghost {
    color: #c9d1d9;
    border-color: #30363d;
}

.auth-alert {
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.auth-alert--error {
    background: #fee2e2;
    border: 1px solid #f87171;
    color: #b91c1c;
}

.auth-alert--warn {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    color: #92400e;
}

.auth-help {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.6;
}

html.theme-dark .auth-help {
    color: #8b949e;
}

.auth-switch {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.875rem;
    color: #64748b;
}

html.theme-dark .auth-switch {
    color: #8b949e;
}

.auth-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
}

.login-remember {
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-remember-input {
    width: 1rem;
    height: 1rem;
    accent-color: #2563eb;
}

html.theme-dark .login-remember {
    color: #c9d1d9;
}

.register-step {
    display: none;
}

.register-step.is-active {
    display: block;
}

.verify-methods {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.verify-method {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    border: 1.5px solid #dbeafe;
    background: #f8fbff;
    color: #1e3a8a;
    font-weight: 600;
    cursor: pointer;
    text-align: start;
}

.verify-method i {
    font-size: 1.1rem;
    margin-bottom: 0.15rem;
}

.verify-method small {
    font-weight: 500;
    color: #64748b;
    font-size: 0.75rem;
}

.verify-method.is-disabled,
.verify-method:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

html.theme-dark .verify-method {
    background: #161b22;
    border-color: #30363d;
    color: #79c0ff;
}

html.theme-dark .verify-method small {
    color: #8b949e;
}

.hidden {
    display: none !important;
}