/* ألوان وخط IBM Plex Sans Arabic كما في isa.org.sa. الخط مخزّن محلياً ولا يُطلب من شبكة خارجية. */

@font-face {
    font-family: "IBM Plex Sans Arabic";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/ibm-plex-sans-arabic-arabic-400.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
    font-family: "IBM Plex Sans Arabic";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/ibm-plex-sans-arabic-latin-400.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "IBM Plex Sans Arabic";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/ibm-plex-sans-arabic-arabic-600.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
    font-family: "IBM Plex Sans Arabic";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/ibm-plex-sans-arabic-latin-600.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "IBM Plex Sans Arabic";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("fonts/ibm-plex-sans-arabic-arabic-700.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
    font-family: "IBM Plex Sans Arabic";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("fonts/ibm-plex-sans-arabic-latin-700.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --ink: #1e1a36;
    --muted: #69667a;
    --paper: #f5f7f9;
    --sheet: #ffffff;
    --line: #dddce5;
    --pine: #241953;
    --pine-mid: #312565;
    --sand: #f3f1f8;
    --gold: #178bc9;
    --gold-soft: #e7f7fd;
    --danger: #b42318;
    --danger-bg: #fdecec;
    --focus: #00c0f3;
    --shadow: 0 18px 50px rgba(36, 25, 83, 0.08);
    --radius: 18px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 100% 0, rgba(255, 255, 255, 0.7), transparent 28rem),
        var(--paper);
    font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Arial", sans-serif;
    font-size: 1.05rem;
    line-height: 1.7;
}

a {
    color: var(--pine-mid);
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--focus);
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.skip {
    position: absolute;
    inset-inline-start: 1rem;
    top: 0.6rem;
    z-index: 5;
    background: #fff;
    color: var(--ink);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    transform: translateY(-150%);
}

.skip:focus {
    transform: none;
}

.mast {
    background: var(--pine);
    color: #ffffff;
    padding: 1.15rem 0 3.2rem;
}

.mast-accent {
    height: 4px;
    margin-top: -4px;
    background: linear-gradient(100deg, #00c0f3 0%, #6750ae 58%, #92278f 100%);
}

.mast a {
    color: #ffffff;
}

.mast-inner,
.wrap {
    width: min(980px, calc(100% - 2rem));
    margin-inline: auto;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.brand-logo {
    display: block;
    height: 58px;
    width: auto;
    max-width: min(340px, 70vw);
    object-fit: contain;
    object-position: right center;
}

.product {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffffd0;
}

.sheet {
    background: var(--sheet);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    margin-top: -2.2rem;
    padding: 1.4rem 1.15rem 1.6rem;
}

.sheet.narrow {
    width: min(760px, calc(100% - 2rem));
    margin-inline: auto;
}

.sheet-head h1,
.panel h2,
.error-summary h2 {
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.4rem;
}

.sheet-head h1 {
    font-size: clamp(1.7rem, 2vw, 2.15rem);
}

.lede,
.hint,
.foot,
.program-meta {
    color: var(--muted);
}

.lede {
    margin: 0;
    font-size: 1.05rem;
}

.intro .lede + .lede {
    margin-top: 0.85rem;
}

.intro .lede strong {
    font-weight: 700;
    color: var(--ink);
}

.steps {
    margin: 1.2rem 0 1.3rem;
}

.steps ol {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin: 0;
    padding: 0;
}

.steps a {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 48px;
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--sand);
    color: var(--ink);
    text-decoration: none;
    font-size: 0.95rem;
}

.steps a span {
    display: inline-grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    background: var(--pine);
    color: #f6f1e7;
    font-size: 0.85rem;
    flex: none;
}

.error-summary {
    background: var(--danger-bg);
    border: 1px solid #e4c4c4;
    border-radius: 14px;
    padding: 0.9rem 1rem;
    margin-bottom: 1.1rem;
}

.error-summary ul {
    margin: 0.4rem 0 0;
    padding-inline-start: 1.2rem;
}

.error-summary a {
    color: var(--danger);
}

.panel {
    border-top: 1px solid var(--line);
    padding-top: 1.1rem;
    margin-top: 0.4rem;
}

.panel h2 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.28rem;
}

.num {
    display: inline-grid;
    place-items: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    background: var(--pine);
    color: #f6f1e7;
    font-size: 0.95rem;
}

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

.span-2 {
    grid-column: 1 / -1;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    min-width: 0;
}

label,
legend {
    font-weight: 700;
}

.req {
    color: var(--danger);
    text-decoration: none;
    font-weight: 700;
}

.opt {
    color: var(--muted);
    font-weight: 500;
}

input,
select,
button {
    font: inherit;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="url"],
select {
    width: 100%;
    min-height: 48px;
    padding: 0.55rem 0.75rem;
    border: 1px solid #cfc4b2;
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
}

input[type="file"] {
    width: 100%;
    min-height: 48px;
    padding: 0.55rem 0;
    color: var(--ink);
}

input:focus-visible,
select:focus-visible {
    border-color: var(--pine-mid);
}

.is-invalid input,
.is-invalid select {
    border-color: var(--danger);
}

.field-error {
    margin: 0;
    color: var(--danger);
    font-size: 0.95rem;
}

.hint {
    margin: 0.15rem 0 0;
    font-size: 0.92rem;
}

fieldset {
    border: 0;
    margin: 0.8rem 0 0;
    padding: 0;
    min-width: 0;
}

legend {
    padding: 0;
    margin-bottom: 0.45rem;
}

.choices,
.program-list {
    display: grid;
    gap: 0.65rem;
}

.choice,
.program {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    min-height: 48px;
    padding: 0.75rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
}

.choice input,
.program input {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.3rem;
    accent-color: var(--pine);
    flex: none;
}

.program-body,
.choice span {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.program-title {
    font-weight: 700;
}

.program-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: var(--sand);
    color: #3e4a45;
    padding: 0.05rem 0.65rem;
    font-size: 0.86rem;
}

.pill-example {
    background: #f3e2c2;
    color: #6d4d16;
}

.example-banner {
    background: var(--gold-soft);
    border: 1px solid #e4d2a6;
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    color: #5d4520;
}

.consent span {
    font-weight: 500;
}

.prior-count {
    margin-top: 0.85rem;
    display: block;
}

@supports selector(.prior:has(.prior-yes:checked)) {
    .prior .prior-count {
        display: none;
    }

    .prior:has(.prior-yes:checked) .prior-count,
    .prior .prior-count.is-invalid {
        display: block;
    }
}

.actions {
    margin-top: 1.2rem;
}

.submit {
    appearance: none;
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 14px;
    background: var(--pine);
    color: #f7f3ea;
    font-weight: 700;
    cursor: pointer;
}

.submit:hover {
    background: var(--pine-mid);
}

.reference {
    margin: 1rem 0 0;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: var(--sand);
    font-family: ui-monospace, "Cascadia Mono", "Courier New", monospace;
    font-size: 1.55rem;
    letter-spacing: 0.06em;
    text-align: center;
}

.actions-links {
    margin-top: 1.2rem;
}

.prose p {
    margin: 0 0 0.9rem;
}

.foot {
    padding: 1.6rem 0 2rem;
    font-size: 0.95rem;
    color: #ffffffd6;
    background: #17113b;
}

.foot a {
    color: #ffffff;
}

.edition {
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #76e4ff;
}

.server-warn {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: #fff6e8;
    border: 1px solid #e6c48a;
    color: #5c3b12;
}

.footer-logo {
    display: block;
    height: 46px;
    width: auto;
    max-width: min(260px, 80vw);
    margin-bottom: 0.8rem;
    object-fit: contain;
    object-position: right center;
}

.foot-inner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.foot p {
    margin: 0;
}

.hp {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 760px) {
    .steps ol,
    .grid {
        grid-template-columns: 1fr;
    }

    .sheet {
        padding: 1.1rem 0.9rem 1.3rem;
        border-radius: 18px;
    }

    .mast {
        padding-bottom: 2.4rem;
    }

    .brand-logo {
        height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
    }
}
