@font-face {
    font-family: Vazirmatn;
    src: url("vazirmatn.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

:root {
    color-scheme: light;
    --navy: #101e31;
    --navy-soft: #23364d;
    --navy-muted: #495b71;
    --gold: #ffca40;
    --gold-light: #ffda67;
    --ink: var(--navy);
    --muted: var(--navy-muted);
    --surface: #f5f8fa;
    --line: #dce3eb;
    font-family: Vazirmatn, Tahoma, sans-serif;
    font-size: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    color: var(--ink);
    background: var(--surface);
    line-height: 1.75;
}
main { display: flex; flex: 1 0 auto; flex-direction: column; }
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--navy-soft); outline-offset: 4px; }
.wrap { width: min(100% - 80px, 1140px); margin-inline: auto; }

.site-header { background: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 1.12rem; font-weight: 850; line-height: 1.3; }
.brand img { display: block; flex: none; width: 42px; height: 42px; object-fit: contain; }
.brand bdi { display: block; width: max-content; margin-top: 3px; color: var(--muted); font-size: .8rem; font-weight: 650; }
nav { display: none; }
nav a { display: flex; align-items: center; min-height: 44px; color: var(--muted); font-weight: 700; font-size: .9rem; text-decoration: none; }
nav a:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 5px; }

.hero {
    display: grid;
    flex: 1 0 auto;
    align-content: center;
    isolation: isolate;
    position: relative;
    overflow: clip;
    color: #fff;
    background: radial-gradient(ellipse at 88% 105%, var(--navy-soft), transparent 66%), var(--navy);
}
.hero::before, .hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset-inline-start: -248px;
    bottom: -145px;
    width: 450px;
    height: 450px;
    border: 1px solid rgb(245 248 250 / .15);
    border-radius: 64px;
    transform: rotate(45deg);
}
.hero::after { inset-inline-start: -294px; bottom: -171px; border-color: rgb(255 202 64 / .2); }
.hero-inner {
    display: grid;
    align-items: start;
    grid-template-columns: minmax(0, 1fr) minmax(0, 470px);
    gap: clamp(36px, 6vw, 86px);
    padding-block: clamp(44px, 5vw, 72px);
}
.hero-copy { align-self: start; }
.hero h1 { font-size: clamp(2.45rem, 5.25vw, 4.45rem); font-weight: 880; line-height: 1.24; }
.hero h1 span {
    display: block;
    inline-size: fit-content;
    max-inline-size: 100%;
    color: var(--gold-light);
    text-shadow:
        0 0 3px rgb(255 211 91 / .46),
        0 0 .22em rgb(255 181 38 / .35),
        0 0 .52em rgb(255 156 16 / .23);
}

@media (prefers-reduced-motion: no-preference) {
    @supports (background-clip: text) {
        .hero h1 span {
            /* Keep the overhanging Persian diacritic inside the painted area. */
            padding: .12em .14em .24em;
            margin: -.12em -.14em -.24em;
            max-inline-size: calc(100% + .28em);
            background-image: linear-gradient(
                90deg,
                var(--gold-light) 43%,
                #ffe48c 47%,
                #fff8de 50%,
                #ffe7a0 52%,
                var(--gold-light) 56%
            );
            background-size: 240% 100%;
            background-repeat: no-repeat;
            background-clip: text;
            color: transparent;
            text-shadow: none;
            filter: drop-shadow(0 0 .1em rgb(255 196 54 / .38))
                drop-shadow(0 0 .28em rgb(255 156 16 / .29));
            animation: brand-shine 1.2s cubic-bezier(.45, .1, .55, .9) 260ms both;
        }
    }
}

@keyframes brand-shine {
    from { background-position: left center; }
    to { background-position: right center; }
}

.hero-description { margin-top: 15px; color: #dcebf3; font-size: clamp(1rem, 1.45vw, 1.12rem); line-height: 1.85; text-wrap: balance; }

.lookup {
    min-width: 0;
    padding: clamp(20px, 2.6vw, 34px);
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 12px 30px rgb(8 18 32 / .19);
}
form label { display: block; margin-bottom: 9px; font-size: 1.06rem; font-weight: 790; }
.lookup-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "code" "help" "button";
    gap: 10px;
}
form input {
    grid-area: code;
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 54px;
    padding: 0 13px;
    background: var(--surface);
    border: 1px solid #76899a;
    border-radius: 9px;
    color: var(--ink);
    font: 650 1rem/1 Vazirmatn, Tahoma, sans-serif;
    letter-spacing: .06em;
}
form input::placeholder { color: #536573; opacity: 1; }
form input[aria-invalid="true"] { border-color: #a52d39; }
.field-help { grid-area: help; color: var(--muted); font-size: .9rem; line-height: 1.65; }
form button {
    grid-area: button;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 7px 10px;
    color: #222d31;
    background: var(--gold);
    border: 0;
    border-radius: 9px;
    font: 820 .98rem/1.5 Vazirmatn, Tahoma, sans-serif;
    cursor: pointer;
}
form button:hover:not(:disabled) { background: #ffda78; }
form button:active:not(:disabled) { background: #efb63b; }
form button:disabled { color: #332d23; background: #ffe2a2; cursor: wait; }
form button i { position: relative; width: 14px; height: 2px; background: currentColor; border-radius: 2px; }
form button i::before { position: absolute; content: ""; inset-inline-end: 0; top: -3px; width: 8px; height: 8px; border-left: 2px solid; border-bottom: 2px solid; transform: rotate(45deg); }
form button:disabled i { display: none; }

.notice {
    --notice-color: #365365;
    margin-top: 16px;
    padding: 12px 15px;
    border: 1px solid #c7d7e1;
    border-inline-start: 3px solid var(--notice-color);
    border-radius: 10px;
    background: #f2f7fa;
    color: var(--notice-color);
    font-size: .92rem;
    text-align: start;
    overflow-wrap: anywhere;
}
.notice strong { display: block; line-height: 1.65; }
.notice[data-state="active"] { --notice-color: #126440; background: #edf9f1; }
.notice[data-state="expired"], .notice[data-state="missing"], .notice[data-state="limited"] { --notice-color: #774d10; background: #fff7e6; }
.notice[data-state="empty"], .notice[data-state="invalid"], .notice[data-state="too_long"], .notice[data-state="blocked"], .notice[data-state="error"] { --notice-color: #962b3a; background: #fff1f3; }
.notice dl { margin-top: 8px; color: var(--ink); }
.notice dl div { display: grid; grid-template-columns: minmax(5em, max-content) minmax(0, 1fr); gap: 8px; align-items: baseline; }
.notice dt { color: var(--muted); font-size: .82rem; }
.notice dd { min-width: 0; text-wrap: pretty; }
.notice-support { display: inline-flex; align-items: center; min-height: 44px; font-weight: 750; text-underline-offset: 4px; }

.error-page {
    display: grid;
    place-items: center;
    padding: clamp(16px, 5vw, 48px);
}
.error-card {
    inline-size: min(100%, 34rem);
    padding: clamp(20px, 5vw, 40px);
    border: 1px solid var(--line);
    border-block-start: 4px solid var(--gold);
    border-radius: 16px;
    background: #fff;
    text-align: start;
    overflow-wrap: anywhere;
}
.error-card h1 { font-size: clamp(1.3rem, 4vw, 1.85rem); line-height: 1.5; }
.error-card a {
    display: inline-flex;
    align-items: center;
    min-block-size: 44px;
    margin-block-start: 12px;
    color: var(--navy-soft);
    font-weight: 750;
    text-underline-offset: 4px;
}

.terms { display: grid; flex: 1 0 auto; align-content: center; background: var(--surface); padding-block: clamp(36px, 4.2vw, 56px); }
.terms h2 { margin-bottom: 20px; font-size: clamp(1.55rem, 3vw, 1.97rem); font-weight: 830; line-height: 1.4; }
.terms-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}
.term {
    min-width: 0;
    padding: clamp(18px, 2.4vw, 29px);
}
.term + .term { border-inline-start: 1px solid var(--line); }
.term h3 { margin-bottom: 8px; color: var(--navy); font-size: 1.05rem; font-weight: 810; }
.term-copy { display: grid; gap: 8px; }
.term p { color: var(--muted); font-size: .97rem; line-height: 1.8; overflow-wrap: anywhere; }

.site-footer { padding-block: 28px 33px; background: var(--navy); color: var(--surface); border-top: 2px solid var(--gold); }
.site-footer h2 { font-size: 1.1rem; font-weight: 820; }
.site-footer h2 span { color: var(--gold); margin-inline: 3px; }
.contact-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 20px; margin-top: 13px; padding-top: 12px; border-top: 1px solid #526176; }
.contact-grid dt { color: #b8c9da; font-size: .84rem; font-weight: 720; }
.contact-grid dd { margin-top: 2px; font-size: .93rem; overflow-wrap: anywhere; }
.contact-grid a { color: #fff0ba; display: inline-flex; min-height: 44px; align-items: start; text-underline-offset: 4px; font-weight: 700; }
.contact-grid a:hover { color: #fff; }
.site-footer a:focus-visible { outline-color: var(--gold); }

@media (max-width: 1050px) {
    .wrap { width: calc(100% - 52px); }
    .hero-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; }
}

@media (max-width: 820px) {
    .wrap { width: calc(100% - 44px); }
    .lookup { padding: 22px; }
    .terms-list { grid-template-columns: minmax(0, 1fr); }
    .term + .term { border-inline-start: 0; border-block-start: 1px solid var(--line); }
}

@media (max-width: 660px) {
    .wrap { width: min(100% - 34px, 490px); }
    .header-inner { min-height: 64px; }
    .brand { gap: 8px; font-size: .95rem; }
    .brand img { width: 35px; height: 35px; }
    .brand bdi { font-size: .7rem; }
    nav { display: flex; gap: 13px; }
    nav a { font-size: .79rem; }
    .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-block: 23px 27px; }
    .hero h1 { font-size: clamp(2.05rem, 8.4vw, 2.75rem); }
    .hero-description { margin-top: 9px; font-size: .96rem; }
    .lookup { padding: 18px; }
    .terms { padding-block: 28px 35px; }
    .terms h2 { margin-bottom: 14px; }
    .site-footer { padding-block: 24px 28px; }
    .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}

@media (max-width: 360px) {
    .wrap { width: calc(100% - 28px); }
    .header-inner { gap: 8px; }
    nav { gap: 10px; }
    nav a { font-size: .74rem; }
}
