@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Tajawal:wght@400;600;700&display=swap');

:root {
    --font-latin: 'Inter', system-ui, -apple-system, sans-serif;
    --font-arabic: 'Tajawal', 'Cairo', sans-serif;

    --color-bg: #f6f7fb;
    --color-bg-topnav: #ffffff;
    --color-bg-content: #ffffff;
    --color-surface: #ffffff;
    --color-surface-alt: #f0f2f8;
    --color-contrast: #0f172a;
    --color-muted: #5f6b7a;
    --color-soft: #93a0b5;
    --color-border: #e4e7ee;
    --color-border-subtle: #e9edf3;

    --color-primary: #1e3c72;
    --color-primary-strong: #2a5298;
    --color-primary-light: rgba(30, 60, 114, 0.12);
    --color-accent: #f5b041;
    --color-footer-bg: linear-gradient(135deg, #0f172a, #1e3c72);
    --color-footer-text: #f8fafc;
    --color-footer-divider: rgba(255, 255, 255, 0.16);
    --gradient-primary: linear-gradient(135deg, var(--color-primary), var(--color-primary-strong));

    --color-success: #16a34a;
    --color-danger: #ef4444;

    --shadow-light: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-strong: 0 20px 60px rgba(30, 60, 114, 0.18);
    --shadow-dark: 0 20px 45px rgba(0, 0, 0, 0.35);

    --start: left;
    --end: right;
}

[data-theme="dark"] {
    --color-bg: #0f172a;
    --color-bg-topnav: #0b1220;
    --color-bg-content: #111827;
    --color-surface: #111827;
    --color-surface-alt: #0b1220;
    --color-contrast: #e5e7ef;
    --color-muted: #cdd2de;
    --color-soft: #98a2b3;
    --color-border: #24334d;
    --color-border-subtle: #2f4160;

    --color-primary: #3a66bb;
    --color-primary-strong: #4a76cb;
    --color-primary-light: rgba(58, 102, 187, 0.2);
    --color-accent: #f5c76a;
    --color-footer-bg: linear-gradient(135deg, #050a12, #0f172a);
    --color-footer-text: #e5e7ef;
    --color-footer-divider: rgba(229, 231, 239, 0.2);
    --gradient-primary: linear-gradient(135deg, var(--color-primary), var(--color-primary-strong));

    --shadow-light: 0 12px 28px rgba(0, 0, 0, 0.2);
    --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.35);
    --shadow-strong: 0 24px 70px rgba(0, 0, 0, 0.5);
    --shadow-dark: 0 26px 70px rgba(0, 0, 0, 0.55);
}

[dir="rtl"] {
    --start: right;
    --end: left;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.public-body {
    min-height: 100vh;
    margin: 0;
    background-color: var(--color-bg);
    color: var(--color-contrast);
    font-family: var(--font-latin);
    line-height: 1.6;
}

html[dir="rtl"] body.public-body {
    font-family: var(--font-arabic);
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover,
a:focus {
    color: var(--color-primary);
}

img {
    max-width: 100%;
    height: auto;
}

.site-shell {
    background: var(--color-bg);
}

.brand-mark {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.brand-caption {
    font-size: 0.8rem;
    color: var(--color-muted);
}

.public-navbar {
    background-color: var(--color-surface);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--color-border);
    transition: background-color .3s ease, border-color .3s ease, box-shadow .3s ease;
    z-index: 1050;
}

.public-navbar .nav-link {
    color: var(--color-contrast);
    font-weight: 600;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    transition: background-color .2s ease, color .2s ease;
}

.public-navbar .nav-link.active,
.public-navbar .nav-link:hover,
.public-navbar .nav-link:focus {
    background: rgba(30, 60, 114, 0.08);
    color: var(--color-primary-strong);
}

.navbar-actions .btn,
.language-switcher .btn {
    border-radius: 999px;
    font-weight: 600;
}

.navbar-actions .btn-primary {
    box-shadow: 0 12px 24px rgba(30, 60, 114, 0.25);
}

.theme-toggle {
    width: 44px;
    height: 44px;
    border: 1px solid var(--color-border);
    color: var(--color-contrast);
    background-color: var(--color-surface-alt);
}

.theme-toggle:hover,
.theme-toggle:focus {
    background-color: rgba(30, 60, 114, 0.1);
    color: var(--color-primary);
}

.mdb-card,
.stat-card,
.contact-card,
.policy-card,
.terms-card,
.login-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.badge-soft {
    background: rgba(30, 60, 114, 0.1);
    color: var(--color-primary);
    border-radius: 999px;
    font-weight: 700;
}

.contact-card {
    color: var(--color-contrast);
}

.contact-card h5,
.contact-card .fw-semibold {
    color: var(--color-contrast);
}

.contact-card .text-muted,
.contact-card .small {
    color: var(--color-muted) !important;
}

.contact-card .list-unstyled li + li {
    border-top: 1px dashed var(--color-border-subtle);
    padding-top: 0.35rem;
}

.icon-chip {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-strong));
    box-shadow: 0 10px 25px rgba(30, 60, 114, 0.35);
}

.badge-light {
    background: var(--color-surface-alt);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
}

[data-theme="dark"] .badge-light {
    background: rgba(229, 231, 239, 0.08);
    color: var(--color-primary-strong);
    border-color: rgba(229, 231, 239, 0.24);
}

.contact-hero {
    background: radial-gradient(circle at 10% 20%, rgba(58, 102, 187, 0.25), transparent 35%),
                radial-gradient(circle at 80% 0%, rgba(42, 82, 152, 0.32), transparent 30%),
                linear-gradient(135deg, var(--color-primary), var(--color-primary-strong));
    color: #fff;
}

.contact-hero .text-white-50,
.contact-hero p,
.contact-hero .small {
    color: rgba(248, 250, 252, 0.85) !important;
}

.hero-panel {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-strong));
    color: #fff;
    border-radius: 24px;
    box-shadow: var(--shadow-strong);
}

.hero-panel .badge-soft {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: none;
}

.hero-panel .lead,
.hero-panel p,
.hero-panel .text-white-50 {
    color: rgba(248, 250, 252, 0.86) !important;
}

.hero-panel .card {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: var(--shadow-strong);
}

.hero-panel .btn-primary {
    background-color: #fff;
    color: var(--color-primary);
    font-weight: 700;
}

.hero-panel .btn-outline-light {
    border-color: #fff;
    border-width: 2px;
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
}

.hero-panel .btn-outline-light:hover,
.hero-panel .btn-outline-light:focus {
    background-color: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.section-title {
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--color-contrast);
}

.section-lead,
.text-muted,
.text-body-secondary {
    color: var(--color-muted) !important;
}

.stat-card h2 {
    font-weight: 800;
}

.site-footer {
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
}

.site-footer hr {
    border-color: var(--color-footer-divider);
}

.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 12px 26px rgba(30, 60, 114, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .3s ease, transform .3s ease;
    z-index: 1040;
}

[dir="rtl"] .back-to-top {
    right: auto;
    left: 24px;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.page-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease;
    z-index: 1400;
}

.page-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.language-switcher .dropdown-menu {
    min-width: 11rem;
}

.public-body .table {
    color: var(--color-contrast);
    background-color: var(--color-bg-content);
    border-color: var(--color-border);
}

.public-body .table th,
.public-body .table td {
    border-color: var(--color-border);
}

.public-body .table thead th {
    background-color: var(--color-surface-alt);
    color: var(--color-contrast);
}

.public-body .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: var(--color-surface-alt);
}

[data-theme="dark"] .public-body .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(36, 51, 77, 0.35);
}

.public-body .table-hover > tbody > tr:hover {
    background-color: var(--color-primary-light);
    color: var(--color-contrast);
}

[data-theme="dark"] .public-body .table-hover > tbody > tr:hover {
    background-color: rgba(58, 102, 187, 0.18);
}

.form-surface .form-control,
.form-surface .form-select {
    background-color: var(--color-surface-alt);
    border-color: var(--color-border);
    color: var(--color-contrast);
    caret-color: var(--color-contrast);
}

.form-surface .form-control:focus,
.form-surface .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.15rem rgba(30, 60, 114, 0.2);
}

.form-surface .form-label,
.form-surface .form-text,
.form-surface .form-check-label {
    color: var(--color-muted);
}

.form-surface .form-control::placeholder {
    color: var(--color-muted);
    opacity: 0.8;
}

.form-surface .input-group-text {
    background-color: var(--color-surface-alt);
    border-color: var(--color-border);
    color: var(--color-muted);
}

.auth-page {
    color: var(--color-contrast);
}

.login-card {
    background: var(--color-surface);
    border-color: var(--color-border);
    box-shadow: var(--shadow-soft);
}

.login-card .icon-chip {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    box-shadow: var(--shadow-light);
}

.auth-form .form-control,
.auth-form .form-label,
.auth-form .text-muted,
.auth-form .form-check-label {
    color: var(--color-contrast);
}

.auth-form .text-muted,
.auth-form .form-label,
.auth-form .form-check-label,
.auth-form .small {
    color: var(--color-muted) !important;
}

.auth-form .form-control {
    background-color: var(--color-surface-alt);
    border-color: var(--color-border);
    caret-color: var(--color-contrast);
}

.auth-form .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.15rem rgba(30, 60, 114, 0.2);
    background-color: var(--color-surface);
}

.auth-form .input-affix,
.auth-form .input-actions {
    position: absolute;
    inset-block-start: 50%;
    transform: translateY(-50%);
    color: var(--color-muted);
}

.auth-form .input-affix {
    inset-inline-end: 0.75rem;
    pointer-events: none;
}

.auth-form .input-actions {
    inset-inline-end: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-form .input-icon-btn {
    padding: 0.25rem;
    min-width: auto;
    color: var(--color-muted);
}

.auth-form .input-icon-btn:hover,
.auth-form .input-icon-btn:focus {
    color: var(--color-primary);
    text-decoration: none;
}

.auth-form .icon-input {
    padding-inline-end: 2.75rem;
}

.auth-form .icon-input-with-toggle {
    padding-inline-end: 4.5rem;
}

.auth-form .form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.form-surface .form-outline .form-notch,
.form-surface .form-outline .form-notch-leading,
.form-surface .form-outline .form-notch-trailing {
    border-color: var(--color-border);
}

.form-surface .form-outline .form-control:focus ~ .form-notch .form-notch-leading,
.form-surface .form-outline .form-control:focus ~ .form-notch .form-notch-middle,
.form-surface .form-outline .form-control:focus ~ .form-notch .form-notch-trailing {
    border-color: var(--color-primary);
}

.form-surface .form-control:-webkit-autofill,
.form-surface .form-select:-webkit-autofill,
.form-surface textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--color-surface-alt) inset;
    -webkit-text-fill-color: var(--color-contrast);
    caret-color: var(--color-contrast);
    transition: background-color 9999s ease-in-out 0s;
}

[data-theme="dark"] .form-surface .input-group-text {
    background-color: var(--color-surface);
}

.contact-form .input-group-text {
    min-width: 48px;
    justify-content: center;
}

.theme-transitioning * {
    transition: none !important;
}
