/* الأنماط العامة - نادي ضباط الشرطة (RTL) */

:root {
    --navy: #1e2559;
    --navy-light: #2a3169;
    --gold: #c8a45a;
    --gold-light: #dcbd77;
    --bg: #f4f6fb;
    --white: #ffffff;
    --text: #1a1a1a;
    --muted: #6b7280;
    --danger: #c0392b;
    --success: #1e8449;
    --radius: 12px;
    --shadow: 0 8px 24px rgba(13, 27, 62, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Cairo', 'Tajawal', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    line-height: 1.6;
}

/* ===== صفحة الدخول ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem 2rem;
}

.brand {
    text-align: center;
    margin-bottom: 2rem;
}

.brand .badge {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.brand h1 {
    color: var(--navy);
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
}

.brand p {
    color: var(--muted);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--navy);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--gold);
}

.btn {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.05s;
}

.btn-primary {
    background: var(--gold);
    color: var(--navy);
}

.btn-primary:hover {
    background: var(--gold-light);
}

.btn-primary:active {
    transform: scale(0.99);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-outline {
    display: block;
    text-align: center;
    text-decoration: none;
    background: transparent;
    color: var(--navy);
    border: 1.5px solid var(--navy);
}

.btn-outline:hover {
    background: var(--navy);
    color: var(--white);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* ===== صفحة التسجيل ===== */
.register-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
}

.register-card {
    width: 100%;
    max-width: 640px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

@media (max-width: 560px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--white);
}

.form-group select:focus {
    outline: none;
    border-color: var(--gold);
}

.back-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--navy);
    font-size: 0.9rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    display: none;
}

.alert.show {
    display: block;
}

.alert-error {
    background: #fdecea;
    color: var(--danger);
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #eafaf1;
    color: var(--success);
    border: 1px solid #c3e6cb;
}

/* ===== لوحة التحكم (index) ===== */
.topbar {
    background: var(--navy);
    color: var(--white);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.container {
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.card h3 {
    color: var(--navy);
    margin-bottom: 1rem;
}

.badge-role {
    background: var(--gold);
    color: var(--navy);
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.btn-logout {
    background: transparent;
    color: var(--white);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    padding: 0.4rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ===== شاشة الدخول بتصميم الهوية الجديدة ===== */
.auth-body {
    min-height: 100vh;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    position: relative;
    overflow: hidden;
}
.auth-watermark {
    position: fixed;
    bottom: -40px;
    left: -30px;
    font-size: 15rem;
    opacity: 0.04;
    pointer-events: none;
    transform: rotate(-10deg);
}
.auth-screen {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    z-index: 1;
}
.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 2.5rem;
}
.auth-logo { font-size: 3.5rem; }
.auth-logo-sub {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: 0.5px;
}
.auth-welcome {
    font-size: 2.4rem;
    color: var(--navy);
    font-weight: 800;
    margin-bottom: 2.5rem;
}
.auth-form { display: flex; flex-direction: column; gap: 1.75rem; }
.field-line { text-align: right; }
.field-line label {
    display: block;
    color: var(--navy);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.field-line input {
    width: 100%;
    border: none;
    border-bottom: 1.5px solid #c7ccdd;
    background: transparent;
    padding: 0.5rem 0.2rem;
    font-size: 1.05rem;
    font-family: inherit;
    color: var(--navy);
}
.field-line input:focus {
    outline: none;
    border-bottom-color: var(--gold);
}
.btn-pill {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 999px;
    padding: 0.95rem;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.05s, filter 0.15s;
}
.btn-pill:active { transform: scale(0.985); }
.btn-pill-navy {
    background: var(--navy);
    color: #fff;
    margin-top: 2.25rem;
    box-shadow: 0 10px 24px rgba(30, 37, 89, 0.28);
}
.btn-pill-navy:hover { filter: brightness(1.12); }
.btn-pill-gold {
    background: var(--gold);
    color: var(--navy);
    margin-top: 1rem;
    box-shadow: 0 10px 24px rgba(200, 164, 90, 0.3);
}
.btn-pill-gold:hover { filter: brightness(1.05); }
.auth-link {
    display: block;
    margin-top: 1rem;
    color: var(--navy);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}
.auth-link.muted { color: var(--muted); font-weight: 500; }
.auth-body .alert { border-radius: 12px; margin-bottom: 1rem; }

/* ===== تدفّق إنشاء مستخدم جديد ===== */
.reg-screen { max-width: 420px; }
.reg-head { text-align: center; margin-bottom: 1.5rem; }
.reg-sub { color: var(--muted); font-size: 1rem; margin-top: 0.2rem; }
.type-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.type-pill {
    width: 100%; border: none; border-radius: 999px; padding: 1rem;
    background: var(--gold); color: var(--navy); font-family: inherit;
    font-size: 1.05rem; font-weight: 700; cursor: pointer;
    box-shadow: 0 8px 18px rgba(200,164,90,0.25); transition: transform .05s, box-shadow .15s;
}
.type-pill:active { transform: scale(0.98); }
.type-pill.selected { outline: 3px solid var(--navy); outline-offset: 2px; }
#regForm { display: flex; flex-direction: column; gap: 1.1rem; text-align: right; }
.fld-label { color: var(--navy); font-weight: 700; font-size: 1rem; margin-bottom: -0.4rem; }
.name-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; }
.name-row input, .box-input, .box-select {
    width: 100%; border: 1.5px solid #c7ccdd; border-radius: 10px;
    padding: 0.7rem 0.8rem; font-family: inherit; font-size: 0.95rem; background: #fff; color: var(--navy);
}
.name-row input:focus, .box-input:focus, .box-select:focus { outline: none; border-color: var(--gold); }
.reg-done { text-align: center; padding: 2rem 0; }
.reg-done-icon {
    width: 72px; height: 72px; border-radius: 50%; background: rgba(22,163,74,0.14); color: #16a34a;
    font-size: 2.2rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem;
}
.reg-done h2 { color: var(--navy); margin-bottom: 0.5rem; }
.reg-done .btn-pill-navy { margin-top: 1.5rem; }

/* شعار النادي في صفحات الدخول */
.auth-logo-img { width: 110px; height: 110px; object-fit: contain; }
.auth-watermark { opacity: 0.05; }
