/* auth/auth.css — تنسيق صفحات المصادقة (نسخة محدّثة) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:       #1a56db;
    --primary-dark:  #1448b8;
    --primary-light: #eff6ff;
    --success:       #059669;
    --danger:        #dc2626;
    --warning:       #d97706;
    --text:          #111827;
    --text-muted:    #6b7280;
    --border:        #d1d5db;
    --surface:       #ffffff;
    --bg:            #f3f4f6;
    --radius:        12px;
    --font:          'Segoe UI', Tahoma, Arial, sans-serif;
    --shadow-lg:     0 20px 60px rgba(0,0,0,0.15);
    --shadow-sm:     0 2px 8px rgba(0,0,0,0.07);
}

/* ========== Layout ========== */
body {
    font-family: var(--font);
    direction: rtl;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: #0f172a;
    color: var(--text);
}

/* Left decorative panel */
.auth-hero {
    flex: 1;
    background: linear-gradient(145deg, #1e3a8a 0%, #1a56db 45%, #0ea5e9 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}
.auth-hero::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    top: -100px; left: -100px;
}
.auth-hero::after {
    content: '';
    position: absolute;
    width: 280px; height: 280px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    bottom: -60px; right: -60px;
}
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
}
.hero-icon {
    width: 88px; height: 88px;
    background: rgba(255,255,255,0.15);
    border-radius: 24px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.2em;
    margin: 0 auto 24px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
}
.hero-logo {
    height: 64px;
    width: auto;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}
.hero-content h1 {
    font-size: 1.7em;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.3;
}
.hero-content p {
    font-size: 0.95em;
    opacity: 0.8;
    line-height: 1.7;
    max-width: 300px;
}
.hero-features {
    margin-top: 36px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: right;
    width: 100%;
    max-width: 300px;
}
.hero-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.88em;
    color: #fff;
    backdrop-filter: blur(4px);
}
.hero-feature i { font-size: 1.1em; opacity: 0.85; flex-shrink: 0; }

/* Right form panel */
.auth-panel {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 44px;
    min-height: 100vh;
    overflow-y: auto;
}

/* ========== Card (fallback for simple pages) ========== */
.auth-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 460px;
}

/* ========== Logo ========== */
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo img { height: 54px; margin-bottom: 12px; }
.auth-logo h1 {
    font-size: 1.25em;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}
.auth-logo p { font-size: 0.84em; color: var(--text-muted); }

/* ========== Title ========== */
.auth-panel-header { width: 100%; margin-bottom: 28px; }
.auth-panel-header h2 {
    font-size: 1.5em;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}
.auth-panel-header p { font-size: 0.88em; color: var(--text-muted); }

h2.auth-title {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 8px;
}
h2.auth-title i { color: var(--primary); }

/* ========== Form ========== */
.auth-form { width: 100%; }

.form-group { margin-bottom: 18px; }
.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84em;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.form-group label i { color: var(--primary); font-size: 0.9em; }

.input-wrap {
    position: relative;
}
.input-wrap .input-icon {
    position: absolute;
    top: 50%; right: 13px;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9em;
    pointer-events: none;
}
.input-wrap input {
    padding-right: 38px;
}

.form-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    font-family: var(--font);
    font-size: 0.95em;
    color: var(--text);
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    direction: ltr;
    text-align: right;
}
.form-group input[type="text"][name*="name"],
.form-group input[type="text"][name*="school_name"] {
    direction: rtl;
    text-align: right;
}
.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.12);
    outline: none;
    background: #fff;
}
.form-group input.error { border-color: var(--danger); background: #fff5f5; }
.form-group input::placeholder { color: #c0c8d6; }

/* ========== Buttons ========== */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 9px;
    font-family: var(--font);
    font-size: 0.97em;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s, transform 0.1s, box-shadow 0.18s;
    letter-spacing: 0.02em;
}
.btn:active { transform: scale(0.985); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #0ea5e9 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(26,86,219,0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #0284c7 100%);
    box-shadow: 0 6px 20px rgba(26,86,219,0.4);
}
.btn-primary:disabled { background: #93c5fd; box-shadow: none; cursor: not-allowed; }

.btn-admin {
    background: linear-gradient(135deg, #1e2d44 0%, #374151 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(30,45,68,0.35);
}
.btn-admin:hover {
    background: linear-gradient(135deg, #111827 0%, #1e2d44 100%);
    box-shadow: 0 6px 20px rgba(30,45,68,0.45);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    margin-top: 10px;
}
.btn-outline:hover { background: var(--primary-light); }

/* ========== Alerts ========== */
.alert {
    padding: 11px 14px;
    border-radius: 9px;
    font-size: 0.87em;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    line-height: 1.6;
    border-width: 1px;
    border-style: solid;
}
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert-danger  { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }

/* ========== Links ========== */
.auth-links {
    text-align: center;
    margin-top: 22px;
    font-size: 0.86em;
    color: var(--text-muted);
    line-height: 2;
}
.auth-links a { color: var(--primary); text-decoration: none; font-weight: 700; }
.auth-links a:hover { text-decoration: underline; }
.auth-links .sep { margin: 0 8px; color: var(--border); }

/* ========== Divider ========== */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.8em;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ========== OTP Inputs ========== */
.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    direction: ltr;
    margin: 20px 0;
}
.otp-inputs input {
    width: 52px; height: 58px;
    text-align: center;
    font-size: 1.5em;
    font-weight: 700;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-family: var(--font);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
    color: var(--text);
    direction: ltr;
}
.otp-inputs input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.12);
    outline: none;
    background: #fff;
}
.otp-inputs input.filled {
    border-color: var(--primary);
    background: var(--primary-light);
}

.resend-otp {
    text-align: center;
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 12px;
}
.resend-otp a { color: var(--primary); cursor: pointer; font-weight: 700; }
.resend-otp a.disabled { color: var(--text-muted); pointer-events: none; }
#resendTimer { font-weight: 700; color: var(--warning); }

/* ========== Spinner ========== */
.spinner { display: none; }
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-text { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ========== Admin badge ========== */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1e2d44;
    color: #fff;
    font-size: 0.78em;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 20px;
    letter-spacing: 0.04em;
}
.admin-badge i { font-size: 0.9em; }

/* ========== Responsive ========== */
@media (max-width: 900px) {
    .auth-hero { display: none; }
    .auth-panel {
        max-width: 100%;
        padding: 36px 28px;
        justify-content: flex-start;
        padding-top: 60px;
    }
}
@media (max-width: 480px) {
    .auth-panel { padding: 28px 20px; }
    .auth-card  { padding: 28px 20px; }
    .otp-inputs input { width: 44px; height: 50px; font-size: 1.25em; }
}
