@import url('fonts.css');

:root {
    --ink: #0a2540;
    --ink-soft: #16324f;
    --foam: #2a9d8f;
    --foam-deep: #1f7a6f;
    --sand: #eef3f7;
    --paper: #f7fafc;
    --line: #c5d2de;
    --muted: #5a6f84;
    --danger: #b42318;
    --warn: #9a6700;
    --ok: #0f7a4c;
    --shadow: 0 18px 50px rgba(10, 37, 64, 0.12);
    --font-display: "DM Serif Display", Georgia, serif;
    --font-body: "Outfit", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--sand);
    line-height: 1.55;
    min-height: 100vh;
}

html[dir="rtl"] body { direction: rtl; text-align: right; }
html[dir="rtl"] .header-inner,
html[dir="rtl"] .brand,
html[dir="rtl"] .footer-inner,
html[dir="rtl"] .result-top,
html[dir="rtl"] .result-actions { direction: rtl; }
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select { text-align: right; }
html[dir="rtl"] input[name*="certificate"],
html[dir="rtl"] input[name*="code"],
html[dir="rtl"] .qr-box { direction: ltr; text-align: left; }

.page-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 50% at 10% -10%, rgba(42, 157, 143, 0.18), transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(10, 37, 64, 0.14), transparent 50%),
        linear-gradient(180deg, #d9e4ee 0%, var(--sand) 38%, #e6edf3 100%);
}

.page-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%230a2540' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

a { color: var(--foam-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
    width: min(1120px, calc(100% - 2rem));
    margin-inline: auto;
}

.site-header {
    padding: 1.25rem 0;
    animation: rise 0.7s ease both;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.65rem;
    background:
        linear-gradient(145deg, var(--foam), var(--ink));
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
    position: relative;
    flex-shrink: 0;
}

.brand-logo {
    width: 2.75rem;
    height: 2.75rem;
    object-fit: contain;
    border-radius: 0.45rem;
    background: #fff;
    flex-shrink: 0;
}

.brand-mark::after {
    content: "";
    position: absolute;
    inset: 28% 30%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
}

.brand-text {
    display: grid;
    gap: 0.1rem;
}

.brand-text strong {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 400;
}

.brand-text small {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero {
    position: relative;
    overflow: hidden;
    margin: 0.5rem 0 2.5rem;
    padding: 4.5rem 0 5rem;
    color: #f4f8fb;
    background:
        linear-gradient(125deg, #06182c 0%, var(--ink) 48%, #12405a 100%);
    animation: fade-in 0.9s ease both;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 30%, rgba(42, 157, 143, 0.35), transparent 42%),
        linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.25));
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 40rem;
    animation: rise 0.85s 0.1s ease both;
}

.hero-kicker {
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(196, 236, 228, 0.9);
}

.hero-logo {
    display: block;
    width: min(7.5rem, 28vw);
    height: auto;
    max-height: 5.5rem;
    object-fit: contain;
    margin: 0 0 1rem;
    filter: drop-shadow(0 8px 18px rgba(4, 28, 44, 0.28));
}

.hero-brand {
    margin: 0 0 0.85rem;
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    font-weight: 400;
    line-height: 1.08;
}

.hero-lead {
    margin: 0 0 1.75rem;
    font-size: 1.1rem;
    color: rgba(232, 240, 246, 0.88);
    max-width: 34rem;
}

.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.hero-compact {
    padding: 2rem 0 1.5rem;
    margin-bottom: 0.5rem;
}

.hero-compact::before,
.hero-compact .hero-seal {
    display: none;
}

.hero-seal {
    position: absolute;
    right: max(2rem, calc((100% - 1120px) / 2));
    top: 50%;
    translate: 0 -50%;
    width: min(280px, 34vw);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.18);
    background:
        radial-gradient(circle at 40% 35%, rgba(42, 157, 143, 0.45), transparent 55%),
        radial-gradient(circle at 60% 70%, rgba(255, 255, 255, 0.08), transparent 50%);
    box-shadow: inset 0 0 0 18px rgba(255, 255, 255, 0.04);
    animation: pulse-seal 5s ease-in-out infinite;
    pointer-events: none;
}

.site-announcement {
    border-bottom: 1px solid transparent;
}
.site-announcement .wrap {
    padding: 0.85rem 1.25rem;
}
.site-announcement p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
    font-weight: 500;
}
.site-announcement-info {
    background: #e7f5f2;
    color: #145a52;
    border-bottom-color: #b7ddd6;
}
.site-announcement-warning {
    background: #fff4d6;
    color: #7a5b00;
    border-bottom-color: #ecd28a;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.85rem 1.25rem;
    border: 0;
    border-radius: 0.55rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
    background: var(--foam);
    color: #04241f;
    box-shadow: 0 10px 24px rgba(42, 157, 143, 0.35);
}

.btn-primary:hover { background: #34b3a3; }

.btn-secondary {
    background: var(--ink);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

.verify-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 1.5rem;
    padding-bottom: 4rem;
    animation: rise 0.8s 0.15s ease both;
}

.verify-form,
.verify-result,
.notice-block,
.center-card {
    background: var(--paper);
    border: 1px solid rgba(197, 210, 222, 0.9);
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.verify-form,
.notice-block,
.center-card { padding: 1.5rem; }

.verify-result {
    min-height: 28rem;
    padding: 1.75rem;
}

.verify-form h2,
.notice-block h2,
.result-empty h2,
.result-hit h2,
.center-card h1 {
    font-family: var(--font-display);
    font-weight: 400;
    margin: 0 0 0.5rem;
}

.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.form-hint,
.result-empty p,
.notice-block p {
    color: var(--muted);
    margin: 0 0 1.25rem;
}

label {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 1rem;
    font-size: 0.86rem;
    font-weight: 600;
}

label span { color: var(--ink-soft); }

input,
select,
textarea {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 0.55rem;
    font: inherit;
    background: #fff;
    color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(42, 157, 143, 0.35);
    border-color: var(--foam);
}

.verify-form .btn,
.verify-result .btn {
    margin-top: 0.25rem;
}

.verify-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1rem;
}

.verify-tab {
    border: 1px solid var(--line);
    background: #f8fafc;
    color: var(--ink-soft);
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.verify-tab.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.verify-pane {
    display: none;
}

.verify-pane.is-active {
    display: block;
}

.verify-gps-opt {
    margin: 0.5rem 0 1rem;
    padding: 0.75rem 0.85rem;
    border: 1px dashed var(--line);
    border-radius: 0.55rem;
    background: rgba(248, 250, 252, 0.8);
}

.verify-gps-opt .checkbox-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.35rem;
    font-weight: 600;
}

.verify-gps-opt .checkbox-inline input {
    width: auto;
    margin: 0;
}

.verify-gps-opt .help-text {
    display: block;
    margin: 0;
    font-size: 0.78rem;
}

.verify-form .btn,
.center-card .btn { width: 100%; margin-top: 0.35rem; }

.result-empty {
    height: 100%;
    min-height: 22rem;
    display: grid;
    place-content: center;
    text-align: center;
    padding: 1rem;
}

.result-miss h2 { color: var(--danger); }

.result-top {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.candidate-photo {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 0.75rem;
    border: 2px solid var(--line);
    background: #fff;
}

.provider-logo {
    display: block;
    max-height: 40px;
    max-width: 160px;
    margin-top: 0.75rem;
    object-fit: contain;
}

.programme {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.programme-desc {
    color: var(--muted);
    margin: 0 0 1.25rem;
}

.status-pill,
.badge {
    display: inline-block;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 0.65rem;
}

.valid, .active, .found { background: #d9f5e8; color: var(--ok); }
.expired, .pending { background: #fff3cd; color: var(--warn); }
.revoked, .cancelled, .fraudulent, .not_found, .inactive { background: #fde2e1; color: var(--danger); }
.suspended, .archived, .duplicate, .replaced { background: #e8edf2; color: #445566; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
}

.detail-grid > div {
    background: #f0f5f9;
    border-radius: 0.65rem;
    padding: 0.85rem 1rem;
}

.detail-grid dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--foam-deep);
    font-weight: 700;
}

.detail-grid dd {
    margin: 0.25rem 0 0;
    font-weight: 500;
}

.provider-card {
    margin: 0 0 1.25rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.72);
}

.provider-card h3 {
    margin: 0 0 0.85rem;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 400;
}

.provider-card .detail-grid {
    margin-bottom: 0;
}

.status-message {
    font-family: var(--font-display);
    font-size: 1.45rem;
    margin: 0 0 1.25rem;
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.result-qr {
    width: 160px;
    height: 160px;
    border-radius: 0.5rem;
    border: 1px solid var(--line);
    background: #fff;
    padding: 0.35rem;
}

.qr-box img,
.qr-box canvas {
    display: block;
    width: 100% !important;
    height: auto !important;
}

.site-footer {
    background: var(--ink);
    color: rgba(220, 230, 238, 0.85);
    padding: 2rem 0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.site-footer strong {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: #fff;
    display: block;
    margin-bottom: 0.35rem;
}

.site-footer p { margin: 0.2rem 0; font-size: 0.92rem; }
.site-footer a { color: #9fe0d6; }

.center-card {
    width: min(460px, calc(100% - 2rem));
    margin: 4rem auto;
}

.alert {
    padding: 0.8rem 0.95rem;
    border-radius: 0.55rem;
    margin: 0 0 1rem;
    font-size: 0.92rem;
}

.alert.success { background: #d9f5e8; color: var(--ok); }
.alert.danger { background: #fde2e1; color: var(--danger); }
.alert.warning { background: #fff3cd; color: var(--warn); }

.notice-block { margin: 2rem auto 4rem; max-width: 40rem; text-align: center; }
.contact-line { margin-top: 1rem !important; }

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse-seal {
    0%, 100% { transform: translateY(-50%) scale(1); opacity: 0.9; }
    50% { transform: translateY(-50%) scale(1.04); opacity: 1; }
}

@media (max-width: 900px) {
    .hero { padding: 3.25rem 0 3.75rem; }
    .hero-seal { opacity: 0.25; width: 180px; right: -1rem; }
    .verify-layout { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .result-top { flex-direction: column; }
}

/* Public portal v2.1 design system */
:root {
    color-scheme: light;
    --color-navy-950: #071b2b;
    --color-navy-800: #12344d;
    --color-teal-700: #08776d;
    --color-teal-600: #0b8f82;
    --color-teal-100: #dff5f1;
    --color-surface: #ffffff;
    --color-canvas: #f3f7f8;
    --color-text: #102a3a;
    --color-muted: #526a78;
    --color-border: #c8d8dd;
    --color-danger: #a61b1b;
    --color-warning: #785b00;
    --color-success: #08653f;
    --radius-sm: .5rem;
    --radius-md: .85rem;
    --radius-lg: 1.25rem;
    --space-1: .25rem;
    --space-2: .5rem;
    --space-3: .75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --shadow-card: 0 18px 45px rgb(7 27 43 / .09);
    --focus-ring: 0 0 0 3px rgb(11 143 130 / .3);
    --ink: var(--color-text);
    --muted: var(--color-muted);
    --paper: var(--color-surface);
    --line: var(--color-border);
    --foam: var(--color-teal-600);
    --foam-deep: var(--color-teal-700);
    --danger: var(--color-danger);
    --warn: var(--color-warning);
    --ok: var(--color-success);
}

html { scroll-padding-top: 1rem; }
body {
    background: linear-gradient(180deg, #e8f2f3 0, var(--color-canvas) 18rem);
    color: var(--color-text);
    padding-bottom: env(safe-area-inset-bottom);
}
a { text-decoration-thickness: .09em; text-underline-offset: .18em; }
button, input, select, textarea { min-height: 44px; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--color-teal-600); outline-offset: 3px; box-shadow: var(--focus-ring); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; inset-block-start: .5rem; inset-inline-start: .5rem; z-index: 100; padding: .7rem 1rem; background: var(--color-navy-950); color: #fff; border-radius: var(--radius-sm); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.wrap { width: min(1160px, calc(100% - 2rem)); }

.trust-header { background: rgb(255 255 255 / .94); border-bottom: 1px solid var(--color-border); padding: calc(.8rem + env(safe-area-inset-top)) 0 .8rem; backdrop-filter: blur(10px); }
.trust-header__inner, .trust-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.brand-mark { display: grid; place-items: center; color: #fff; font-weight: 800; background: var(--color-teal-700); border-radius: 50%; }
.brand-text strong { font-family: var(--font-body); font-size: 1rem; font-weight: 700; }
.brand-text small { color: var(--color-teal-700); font-weight: 700; letter-spacing: .08em; }
.language-picker { display: flex; align-items: center; gap: var(--space-2); }
.language-picker label { margin: 0; }
.language-picker select { width: auto; min-height: 38px; padding: .35rem 2rem .35rem .65rem; }

.public-main { padding-block: clamp(2rem, 5vw, 4.5rem); }
.portal-intro { max-width: 47rem; margin: 0 auto 2rem; text-align: center; }
.portal-intro h1 { margin: .3rem 0 .6rem; font-family: var(--font-display); font-size: clamp(2.15rem, 6vw, 3.75rem); font-weight: 400; line-height: 1.08; color: var(--color-navy-950); }
.portal-intro > p:last-child { margin: 0; color: var(--color-muted); font-size: 1.08rem; }
.eyebrow { margin: 0 0 .4rem; color: var(--color-teal-700); font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.primary-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.verify-layout { grid-template-columns: minmax(19rem, 25rem) minmax(0, 1fr); gap: clamp(1rem, 3vw, 2rem); padding-bottom: 1rem; animation: none; align-items: start; }
.verify-form { padding: clamp(1.25rem, 3vw, 1.75rem); }
.verify-result { padding: clamp(1.25rem, 4vw, 2.25rem); min-height: 34rem; }
.card-heading { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1.25rem; }
.card-heading h2 { font-family: var(--font-body); font-size: 1.2rem; font-weight: 700; margin: 0; }
.card-heading p { margin: .2rem 0 0; color: var(--color-muted); font-size: .9rem; }
.step-number { display: grid; place-items: center; flex: 0 0 2rem; height: 2rem; border-radius: 50%; color: #fff; background: var(--color-navy-800); font-weight: 700; }

.method-switcher { border: 0; padding: 0; margin: 0 0 1rem; }
.method-switcher legend { margin-bottom: .45rem; font-size: .86rem; font-weight: 700; }
.method-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.method-option { margin: 0; cursor: pointer; }
.method-option input { position: absolute; opacity: 0; pointer-events: none; }
.method-option span { display: grid; place-items: center; min-height: 42px; padding: .5rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: #f8fbfb; text-align: center; }
.method-option input:checked + span { color: #fff; border-color: var(--color-navy-800); background: var(--color-navy-800); }
.method-option input:focus-visible + span { outline: 3px solid var(--color-teal-600); outline-offset: 2px; }
.verify-pane { margin-top: 1rem; }
.verify-pane.is-active { display: block; }
.verify-form > label, .verify-pane > label, .password-gate label { display: block; margin: .9rem 0 .35rem; color: var(--color-navy-800); font-weight: 700; }
.optional { color: var(--color-muted); font-weight: 500; }
input, select, textarea { border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: #fff; }
input:hover, select:hover, textarea:hover { border-color: #8da7b0; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--color-teal-700); }
.field-help, .privacy-note { margin: .35rem 0 .8rem; color: var(--color-muted); font-size: .78rem; line-height: 1.45; }
.verify-gps-opt { margin-block: 1rem; border-style: solid; background: #f7fafb; }
.checkbox-inline { min-height: 44px; }
.scanner-hook { width: 100%; }
.qr-scan-actions, .offline-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: .55rem;
    margin: .65rem 0;
}
.file-btn { display: grid; place-items: center; cursor: pointer; margin: 0; }
.file-btn input { display: none; }
.pwa-install-btn { min-height: 36px; padding: .35rem .8rem; font-size: .85rem; }
.connectivity-banner {
    background: #16324f;
    color: #f7fafc;
    text-align: center;
    padding: .55rem 1rem;
    font-size: .9rem;
}
body.is-offline .connectivity-banner { display: block; }
.qr-scanner-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(10, 37, 64, 0.55);
}
.qr-scanner-dialog {
    width: min(420px, 100%);
    background: #fff;
    border-radius: var(--radius-lg, 12px);
    padding: 1rem;
    box-shadow: var(--shadow-card, 0 18px 50px rgba(10, 37, 64, 0.2));
}
.qr-scanner-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}
.qr-scanner-close {
    border: 0;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-navy-800, #0a2540);
}
.qr-scanner-dialog video {
    width: 100%;
    border-radius: 8px;
    background: #0a2540;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}
.qr-scanner-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    margin-top: .75rem;
}
.verify-form > .btn-primary { width: 100%; }
.btn { min-height: 44px; border-radius: var(--radius-sm); }
.btn-primary { background: var(--color-teal-700); color: #fff; box-shadow: none; }
.btn-primary:hover { background: #06635b; }
.btn-secondary { background: var(--color-navy-800); }
.btn-ghost { background: #fff; }

.result-state { min-height: 28rem; display: grid; place-content: center; justify-items: center; text-align: center; max-width: 36rem; margin: auto; }
.result-state > p { color: var(--color-muted); }
.result-icon { display: grid; place-items: center; width: 4rem; height: 4rem; margin-bottom: 1rem; border-radius: 50%; background: var(--color-teal-100); color: var(--color-teal-700); font-size: 1.8rem; font-weight: 700; }
.result-error .result-icon { color: var(--color-danger); background: #fde8e8; }
.progressive-steps { display: flex; gap: 1rem; margin: 1.5rem 0 0; padding: 0; list-style: none; color: var(--color-muted); font-size: .8rem; }
.progressive-steps li { display: grid; justify-items: center; gap: .4rem; }
.progressive-steps span { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border: 1px solid var(--color-border); border-radius: 50%; color: var(--color-navy-800); font-weight: 700; }
.status-banner { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.5rem; padding: .9rem 1rem; border-radius: var(--radius-md); }
.status-banner > span { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: currentColor; color: #fff; }
.status-banner strong, .status-banner small { display: block; }
.status-banner small { margin-top: .1rem; font-size: .8rem; }
.status-banner.valid, .status-banner.active { background: #e1f5ea; color: var(--color-success); }
.status-banner.expired, .status-banner.pending { background: #fff3cc; color: var(--color-warning); }
.status-banner.revoked, .status-banner.fraudulent, .status-banner.cancelled { background: #fde8e8; color: var(--color-danger); }
.status-banner.suspended, .status-banner.archived, .status-banner.duplicate, .status-banner.replaced { background: #e9eef1; color: var(--color-navy-800); }
.result-top h2 { margin: .1rem 0; font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 400; }
.section-title { margin: 1.5rem 0 .8rem; font-size: 1rem; }
.detail-grid > div { border: 1px solid #dce7ea; background: #f7fafb; }
.detail-grid dt { color: var(--color-muted); }
.detail-grid dd { overflow-wrap: anywhere; color: var(--color-navy-950); }
.result-actions { align-items: flex-start; }
.action-buttons { display: flex; flex: 1; flex-wrap: wrap; gap: .6rem; }
.result-qr { flex: 0 0 160px; }
.table-wrap { overflow-x: auto; margin-top: 1rem; }
.matches-table { width: 100%; border-collapse: collapse; }
.matches-table caption { padding: .5rem; color: var(--color-muted); text-align: start; }
.matches-table th, .matches-table td { padding: .8rem .65rem; border-bottom: 1px solid var(--color-border); text-align: start; vertical-align: top; }
.matches-table th { color: var(--color-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.row-link { font-weight: 700; }
.site-footer { margin-top: 2rem; padding-bottom: calc(2rem + env(safe-area-inset-bottom)); background: var(--color-navy-950); }

html[dir="rtl"] .language-picker select { padding: .35rem .65rem .35rem 2rem; }
html[dir="rtl"] .matches-table th, html[dir="rtl"] .matches-table td, html[dir="rtl"] .matches-table caption { text-align: right; }
html[dir="rtl"] input[name="certificate_number"], html[dir="rtl"] input[name="candidate_ref"], html[dir="rtl"] textarea[name="qr_payload"] { direction: ltr; text-align: left; }

@media (max-width: 760px) {
    .wrap { width: min(100% - 1rem, 42rem); }
    .trust-header__inner { align-items: flex-start; }
    .trust-actions { align-items: flex-end; flex-direction: column; gap: .35rem; }
    .brand-text strong { max-width: 13rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .public-main { padding-block: 1.75rem; }
    .portal-intro { text-align: start; padding-inline: .4rem; }
    .verify-layout { display: flex; flex-direction: column; }
    .verify-form, .verify-result { width: 100%; border-radius: var(--radius-md); }
    .verify-result { min-height: 20rem; }
    .detail-grid { grid-template-columns: 1fr; }
    .result-top { flex-direction: row; }
    .candidate-photo { width: 76px; height: 76px; }
    .progressive-steps { flex-direction: column; align-items: flex-start; }
    .progressive-steps li { grid-template-columns: 1.7rem 1fr; align-items: center; justify-items: start; text-align: start; }
    .matches-table thead { display: none; }
    .matches-table, .matches-table tbody, .matches-table tr, .matches-table td { display: block; width: 100%; }
    .matches-table tr { margin-bottom: .8rem; padding: .65rem; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
    .matches-table td { display: grid; grid-template-columns: minmax(7rem, 38%) 1fr; gap: .6rem; padding: .45rem; border: 0; }
    .matches-table td::before { content: attr(data-label); color: var(--color-muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; }
    .matches-table td:last-child { display: block; }
    .row-link { display: block; padding: .65rem; border-radius: var(--radius-sm); background: var(--color-navy-800); color: #fff; text-align: center; }
    .result-actions, .action-buttons { display: grid; width: 100%; }
    .result-qr { margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (prefers-contrast: more), (forced-colors: active) {
    :root { --color-border: currentColor; --shadow-card: none; }
    .primary-card, input, select, textarea, .btn, .method-option span, .detail-grid > div { border-width: 2px; }
    .status-pill, .status-banner { border: 2px solid currentColor; }
    .btn-primary, .btn-secondary, .row-link { forced-color-adjust: none; }
}
