:root {
    --navy: #0f1c2c;
    --deep-navy: #111e3f;
    --gold: #e2b72f;
    --paper: #f8f9ff;
    --line: #dce5f3;
    --muted: #475970;
    --radius: 16px;
    --zz-font: Inter, system-ui, sans-serif;
}

[lang=ar] {
    --zz-font: "IBM Plex Sans Arabic", Tahoma, system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    color: var(--navy);
    font: 16px/1.65 Inter, system-ui, sans-serif;
}

[lang=ar] body {
    font-family: "IBM Plex Sans Arabic", Tahoma, system-ui, sans-serif;
}

main {
    flex: 1;
}

a {
    color: inherit;
    text-underline-offset: 4px;
}

.wrap {
    width: min(1120px, calc(100% - 36px));
    margin-inline: auto;
}

.hero {
    padding: clamp(46px, 9vw, 115px) 0;
    background: radial-gradient(ellipse at 80% 10%, #293c60, transparent 60%), var(--navy);
    color: #fff;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.8rem);
    line-height: 1.22;
    margin: 0 0 14px;
}

.eyebrow {
    color: #785b00;
    font-size: .83rem;
    font-weight: 800;
    letter-spacing: .09em;
}

.hero .eyebrow {
    color: var(--gold);
}

.hero>div>p:not(.eyebrow) {
    color: #dce6f6;
}

.choices,
.grid,
.fields {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choices {
    margin-top: 38px;
}

.choice,
.card {
    background: #fff;
    color: var(--navy);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    padding: clamp(18px, 3vw, 32px);
    box-shadow: 0 12px 30px #0f1c2c0a;
}

.choice {
    display: block;
    text-decoration: none;
    border-block-start: 4px solid var(--gold);
}

.choice h2,
.card h2 {
    margin-block: 8px;
}

.choice p {
    color: var(--muted);
}

.symbol {
    display: inline-grid;
    place-items: center;
    width: 47px;
    height: 47px;
    border-radius: 12px;
    background: #eff4ff;
    font-size: 1.4rem;
}

.page {
    padding-block: 36px 60px;
}

.page h1 {
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.button,
button {
    display: inline-block;
    background: var(--gold);
    color: #1b210f;
    padding: 9px 16px;
    border-radius: 9px;
    border: 1px solid transparent;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.button:hover,
button:hover {
    filter: brightness(.94);
}

:focus-visible {
    outline: 3px solid #ae7800;
    outline-offset: 3px;
}

.plain {
    background: transparent;
    color: var(--navy);
    padding-inline: 0;
}

.narrow {
    max-width: 580px;
    margin-inline: auto;
}

label {
    display: block;
    margin-block: 10px;
    font-weight: 600;
}

input,
textarea,
select {
    display: block;
    width: 100%;
    margin-top: 5px;
    border: 1px solid #aab9ce;
    padding: 9px 10px;
    font: inherit;
    border-radius: 8px;
    background: white;
    color: var(--navy);
}

input[type=file] {
    max-width: 100%;
}

textarea {
    min-height: 78px;
}

.check input {
    display: inline;
    width: auto;
}

dt {
    color: var(--muted);
    margin-top: 8px;
}

dd {
    margin-inline-start: 0;
    font-weight: 700;
}

.row {
    padding-block: 10px;
    border-bottom: 1px solid var(--line);
}

.row form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tabs,
.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-block: 20px;
}

.tabs .button {
    background: #e5eeff;
}

.tabs .selected {
    background: var(--navy);
    color: #fff;
}

.record {
    margin-block: 12px;
}

.record summary {
    cursor: pointer;
    font-weight: 700;
}

.badge {
    display: inline-block;
    background: #e5eeff;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: .85rem;
}

.flash {
    margin-block: 15px;
    padding-inline: 16px;
    border: 1px solid #d2ae77;
    border-radius: 10px;
    background: #fff7e5;
}

@media (max-width: 650px) {

    .choices,
    .grid,
    .fields {
        grid-template-columns: 1fr;
    }
}

/* Minimal scoped reset for Tailwind-styled areas (preflight is disabled so legacy pages keep their styles). */
:where(.tw),
:where(.tw) *,
:where(.tw) *::before,
:where(.tw) *::after {
    box-sizing: border-box;
    border-width: 0;
    border-style: solid;
    border-color: currentColor;
}

:where(.tw) :is(h1, h2, h3, h4, p, label, ul) {
    margin: 0;
    padding: 0;
    list-style: none;
}

:where(.tw-reset) :is(input, select, textarea, button) {
    margin: 0;
    border-width: 0;
    border-style: solid;
    filter: none;
    font: inherit;
    width: auto;
    display: inline-block;
    background: transparent;
}

:where(.tw) :is(input, select, button) {
    margin: 0;
    border-width: 0;
    border-style: solid;
    filter: none;
    font: inherit;
}

:where(.tw) button {
    background: transparent;
    color: inherit;
    padding: 0;
    cursor: pointer;
}

:where(.tw) a {
    text-decoration: none;
}

:where(.tw) img {
    max-width: 100%;
    display: block;
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
}

.gold-gradient-bg {
    background: linear-gradient(135deg, #8c6407 0%, #c59b27 50%, #e2b342 100%);
}

.gold-metallic-text {
    background: linear-gradient(135deg, #f3d482 0%, #e2b342 35%, #c59b27 65%, #f3d482 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
}

/* Admin Panel Preloader */
#admin-preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(15, 28, 44, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

#admin-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.admin-preloader-ring {
    width: 64px;
    height: 64px;
    border-radius: 9999px;
    border: 3px solid rgba(226, 179, 66, 0.2);
    border-top-color: #e2b342;
    border-right-color: #c59b27;
    animation: zz-spin 0.8s linear infinite;
}

@keyframes zz-spin {
    to {
        transform: rotate(360deg);
    }
}