/* ============================================================
   صفحات الدخول والاستعادة (شاشة كاملة، خارج قالب لوحة التحكم)
   تُستخدم مع Pages/Shared/_AuthLayout.cshtml
   ============================================================ */
:root {
    --brand-900: #081c34;
    --brand-800: #0d2748;
    --brand-700: #123360;
    --brand-600: #174078;
    --brand-500: #1c5096;
    --brand-400: #2563b8;
    --gold-500: #c8922a;
    --gold-400: #e0a830;
    --gold-300: #f0c060;
    --gold-100: #fdf5e0;
    --surface-bg: #eef2f7;
    --text-primary: #0f1f35;
    --text-secondary: #4a6080;
    --text-muted: #8aa0b8;
    --border-light: #dce6f0;
    --danger: #d64545;
    --green-600: #1f8a5f;
    --green-50: #e9f7f1;
}

* { box-sizing: border-box; }

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    color: var(--text-primary);
    overflow: hidden;
}

/* ── لوحة الهوية (يمين في RTL) ── */
.brand-panel {
    flex: 0 0 42%;
    background: linear-gradient(150deg, var(--brand-900) 0%, var(--brand-700) 50%, var(--brand-500) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.brand-panel::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    background: rgba(255,255,255,.05);
    border-radius: 50%;
    top: -150px; left: -150px;
    animation: pulse 6s ease-in-out infinite;
}

.brand-panel::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    background: rgba(224,168,48,.10);
    border-radius: 50%;
    bottom: -80px; right: -80px;
    animation: pulse 8s ease-in-out infinite reverse;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.1); }
}

.brand-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .18;
}

.blob-1 { width: 200px; height: 200px; background: var(--gold-300); top: 18%; right: 10%; animation: float 7s ease-in-out infinite; }
.blob-2 { width: 150px; height: 150px; background: var(--brand-400); bottom: 22%; left: 14%; animation: float 9s ease-in-out infinite reverse; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-20px); }
}

.brand-logo {
    width: 90px; height: 90px;
    background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
    border-radius: 24px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 26px;
    box-shadow: 0 8px 26px rgba(200,146,42,.35);
    position: relative; z-index: 1;
    animation: fadeDown .7s ease-out;
}

.brand-logo i { font-size: 42px; color: var(--brand-900); }

.brand-title {
    color: #fff;
    font-size: 1.9rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 10px;
    position: relative; z-index: 1;
    animation: fadeDown .8s ease-out;
}

.brand-subtitle {
    color: rgba(232,240,250,.82);
    font-size: 1rem;
    text-align: center;
    line-height: 1.75;
    max-width: 300px;
    position: relative; z-index: 1;
    animation: fadeDown .9s ease-out;
}

.brand-features {
    margin-top: 34px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 320px;
    position: relative; z-index: 1;
    animation: fadeDown 1s ease-out;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,.14);
    color: #fff;
    font-size: .9rem;
    font-weight: 500;
}

.brand-feature i { font-size: 18px; color: var(--gold-300); flex-shrink: 0; width: 20px; text-align: center; }

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-15px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── لوحة النموذج ── */
.form-panel {
    flex: 1;
    background:
        radial-gradient(circle at 15% 15%, rgba(200,146,42,.10), transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(28,80,150,.08), transparent 40%),
        var(--surface-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    overflow-y: auto;
}

.login-card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(8,28,52,.14);
    padding: 34px 30px;
    width: 100%;
    max-width: 460px;
    animation: slideUp .5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card-heading { text-align: center; margin-bottom: 24px; }

.card-heading h1 {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.card-heading p { font-size: .9rem; color: var(--text-secondary); margin: 0; }

/* أيقونة دائرية أعلى بطاقات الاستعادة */
.card-icon {
    width: 62px; height: 62px;
    margin: 0 auto 14px;
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
}

.card-icon-brand { background: linear-gradient(135deg, var(--gold-100), #e6eef8); color: var(--brand-600); }
.card-icon-success { background: var(--green-50); color: var(--green-600); }

/* ── التبويبات ── */
.tab-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--surface-bg);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 24px;
    gap: 4px;
}

.tab-btn {
    border: none;
    background: transparent;
    border-radius: 10px;
    padding: 11px 8px;
    font-family: inherit;
    font-size: .84rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.tab-btn i { font-size: 15px; }

.tab-btn.active {
    background: #fff;
    color: var(--brand-600);
    box-shadow: 0 2px 10px rgba(8,28,52,.10);
}

.login-section { display: none; animation: fadeIn .3s ease-out; }
.login-section.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── بطاقة الدخول الموحد ── */
.sso-card {
    text-align: center;
    padding: 24px 18px;
    border: 2px dashed var(--border-light);
    border-radius: 16px;
    margin-bottom: 16px;
}

.sso-icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--gold-100), #e6eef8);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.sso-icon i { font-size: 28px; color: var(--brand-600); }

.sso-card h3 { font-size: 1rem; font-weight: 800; color: var(--text-primary); margin-bottom: 6px; }
.sso-card p { font-size: .84rem; color: var(--text-secondary); margin-bottom: 18px; }

/* ── الحقول ── */
.field-label {
    display: block;
    font-size: .88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.field-wrap { position: relative; margin-bottom: 4px; }

.field-icon {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
    z-index: 2;
    transition: color .2s;
}

.field-wrap:focus-within .field-icon { color: var(--brand-500); }

.field-input {
    width: 100%;
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    padding: 12px 42px 12px 14px;
    font-family: inherit;
    font-size: .95rem;
    color: var(--text-primary);
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.field-input:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px rgba(28,80,150,.10);
}

.field-input.input-validation-error { border-color: var(--danger); }
.field-input.input-validation-error:focus { box-shadow: 0 0 0 4px rgba(214,69,69,.10); }

.field-input:disabled { background: var(--surface-bg); color: var(--text-secondary); }

.toggle-pw {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    z-index: 2;
    background: none;
    border: none;
    padding: 4px;
    line-height: 1;
    transition: color .2s;
}

.toggle-pw:hover { color: var(--brand-500); }

.field-error {
    display: block;
    font-size: .8rem;
    color: var(--danger);
    margin-top: 4px;
    min-height: 4px;
}

.field-hint {
    display: block;
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.field-group { margin-bottom: 14px; }

.form-extras {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 6px 0 20px;
}

.custom-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
}

.custom-check input[type="checkbox"] {
    width: 17px; height: 17px;
    accent-color: var(--brand-600);
    cursor: pointer;
    margin: 0;
}

.custom-check span { font-size: .88rem; color: var(--text-secondary); font-weight: 600; }

.link-muted {
    font-size: .85rem;
    font-weight: 700;
    color: var(--brand-600);
    text-decoration: none;
}

.link-muted:hover { color: var(--brand-800); text-decoration: underline; }

/* ── الأزرار ── */
.btn-primary-full,
.btn-sso {
    width: 100%;
    padding: 13px;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary-full { background: linear-gradient(135deg, var(--brand-600), var(--brand-800)); margin-bottom: 18px; }
.btn-sso { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); }

.btn-primary-full:hover,
.btn-sso:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(23,64,120,.32);
}

.btn-primary-full:active, .btn-sso:active { transform: translateY(0); }

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px;
    border-radius: 12px;
    border: 1.5px solid var(--border-light);
    background: #fff;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
    transition: all .25s cubic-bezier(.4,0,.2,1);
}

.btn-back:hover { border-color: var(--brand-500); color: var(--brand-700); }

.btn-dev {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 10px;
    padding: 9px;
    border-radius: 10px;
    border: 1.5px dashed var(--border-light);
    background: #fff;
    color: var(--text-secondary);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
}

.btn-dev:hover { color: var(--brand-600); border-color: var(--brand-400); }

/* ── روابط التسجيل ── */
.register-section {
    border-top: 1px solid var(--border-light);
    padding-top: 18px;
    margin-top: 4px;
}

.register-label {
    text-align: center;
    font-size: .85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.register-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-reg {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 8px;
    border-radius: 12px;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    border: 1.5px solid var(--border-light);
    background: #fff;
    color: var(--text-secondary);
    transition: all .25s cubic-bezier(.4,0,.2,1);
}

.btn-reg i { font-size: 15px; color: var(--brand-500); transition: color .25s; }

.btn-reg:hover {
    transform: translateY(-2px);
    border-color: var(--brand-500);
    background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
    color: #fff;
    box-shadow: 0 6px 18px rgba(23,64,120,.28);
}

.btn-reg:hover i { color: var(--gold-300); }

/* ── شارات الأدوار ── */
.badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 18px;
}

.role-badge {
    background: var(--surface-bg);
    border: 1px solid var(--border-light);
    color: var(--brand-600);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .76rem;
    font-weight: 700;
}

/* ── التنبيهات ── */
.alert-custom {
    border-radius: 12px;
    padding: 11px 15px;
    margin-bottom: 18px;
    font-size: .87rem;
    font-weight: 600;
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.alert-custom i { margin-top: 3px; }
.alert-error { background: #fdf0f0; border: 1px solid #f5c9c9; color: var(--danger); }
.alert-warn  { background: var(--gold-100); border: 1px solid var(--gold-300); color: #8a6316; }
.alert-info  { background: #eef4fb; border: 1px solid #cfe0f2; color: var(--brand-700); }
.alert-custom ul { margin: 0; padding-right: 16px; }

/* لا تُظهر صندوق ملخص الأخطاء عندما لا توجد أخطاء */
.validation-summary-valid { display: none; }

.support-note {
    text-align: center;
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: 18px;
}

.text-center-note {
    text-align: center;
    font-size: .88rem;
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 22px;
}

/* ── الشاشات الصغيرة ── */
@media (max-width: 992px) {
    body { overflow: auto; display: block; }
    .brand-panel { display: none; }
    .form-panel { min-height: 100vh; padding: 24px 16px; }
    .login-card { padding: 28px 20px; }
}

@media (max-width: 480px) {
    .register-grid { grid-template-columns: 1fr; }
    .tab-btn { font-size: .78rem; padding: 10px 6px; }
}
