:root {
    color-scheme: light;
    --navy: #0b1b33;
    --blue: #1259a7;
    --blue-deep: #0c437f;
    --ice: #eef5fc;
    --white: #ffffff;
    --gold: #d4a846;
    --ink-muted: #607086;
    --line: #cad8e8;
}

* { box-sizing: border-box; }

html { background: var(--navy); }

body {
    min-width: 320px;
    margin: 0;
    background: linear-gradient(160deg, var(--navy) 0 30%, var(--ice) 30% 100%);
    color: var(--navy);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans KR", sans-serif;
    -webkit-tap-highlight-color: rgba(18, 89, 167, .2);
}

button,
a { touch-action: manipulation; }

.shell {
    width: min(100%, 680px);
    min-height: 100vh;
    margin: 0 auto;
    padding: max(56px, env(safe-area-inset-top)) 22px calc(36px + env(safe-area-inset-bottom));
}

.brand-block {
    max-width: 530px;
    margin-bottom: 48px;
    color: var(--white);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--gold);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .17em;
}

h1,
h2,
p { overflow-wrap: anywhere; }

h1 {
    margin: 0;
    font-size: clamp(34px, 8vw, 54px);
    line-height: 1.08;
    letter-spacing: -.055em;
    text-wrap: balance;
}

.brand-block > p:last-child {
    max-width: 420px;
    margin: 18px 0 0;
    color: #dce8f7;
    font-size: 16px;
    line-height: 1.75;
}

.company-panel,
.message-card {
    position: relative;
    padding: 30px;
    border-radius: 6px 6px 22px 6px;
    background: var(--white);
    box-shadow: 0 22px 60px rgba(4, 16, 34, .22);
}

.company-panel::before,
.message-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    border-radius: 6px 0 0 6px;
    background: var(--gold);
}

.company-panel h2 {
    margin: 0 0 18px;
    font-size: 17px;
}

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

.company-grid button {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    min-height: 66px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--white);
    color: var(--navy);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.company-grid button:hover {
    border-color: var(--blue);
    background: var(--ice);
}

.company-grid button:active { background: #dfeefa; }

.company-mark {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    background: var(--navy);
    color: var(--white);
    font-size: 13px;
}

.company-arrow {
    color: var(--blue);
    font-size: 20px;
}

.company-grid button:focus-visible,
.primary-link:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

.privacy-note {
    margin: 18px 4px 0;
    color: var(--ink-muted);
    font-size: 13px;
    line-height: 1.65;
}

.shell--message {
    display: grid;
    place-items: center;
}

.message-card {
    width: min(100%, 520px);
    padding: 42px;
}

.message-card h1 { font-size: clamp(32px, 8vw, 46px); }

.message-card > p:not(.eyebrow) {
    margin: 18px 0 26px;
    color: var(--ink-muted);
    line-height: 1.7;
}

.primary-link {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border-radius: 8px;
    background: var(--blue);
    color: var(--white);
    font-weight: 700;
    text-decoration: none;
}

.primary-link:hover { background: var(--blue-deep); }
.primary-link:active { transform: translateY(1px); }

.shell--pass {
    padding-top: max(34px, env(safe-area-inset-top));
}

.pass-heading {
    margin: 0 4px 24px;
    color: var(--white);
}

.pass-heading h1 {
    font-size: clamp(32px, 8vw, 48px);
}

.pass-heading > p:last-child {
    margin: 12px 0 0;
    color: #dce8f7;
    line-height: 1.6;
}

.pass-card {
    overflow: hidden;
    border-radius: 6px 6px 22px 6px;
    background: var(--white);
    box-shadow: 0 22px 60px rgba(4, 16, 34, .25);
}

.pass-identity {
    display: flex;
    min-height: 142px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 26px 28px 24px 34px;
    border-left: 7px solid var(--gold);
    border-bottom: 1px solid var(--line);
}

.pass-company {
    margin: 0 0 8px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .04em;
}

.pass-identity h2 {
    margin: 0;
    font-size: clamp(28px, 7vw, 40px);
    letter-spacing: -.04em;
}

.pass-organization {
    margin: 8px 0 0;
    color: var(--ink-muted);
}

.verified-mark {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    margin: 3px 0 0;
    color: #11663c;
    font-size: 12px;
    font-weight: 800;
}

.verified-mark span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1b9a5a;
    box-shadow: 0 0 0 4px #e0f4e9;
}

.qr-wrap {
    position: relative;
    display: grid;
    place-items: center;
    padding: 24px 24px 10px;
}

.qr-image {
    display: block;
    width: min(100%, 320px);
    height: auto;
    transition: filter .2s ease, opacity .2s ease;
}

.expired-label {
    position: absolute;
    display: none;
    margin: 0;
    padding: 10px 18px;
    border: 2px solid var(--navy);
    background: var(--white);
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -.03em;
}

.pass-card.is-expired .qr-image {
    opacity: .12;
    filter: blur(7px);
}

.pass-card.is-expired .expired-label { display: block; }

.pass-timer {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 0 28px;
    padding: 16px 0 8px;
    border-top: 1px solid var(--line);
    color: var(--ink-muted);
    font-size: 13px;
    font-weight: 700;
}

.pass-timer time {
    color: var(--navy);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 27px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.05em;
}

.pass-status {
    margin: 0;
    padding: 0 28px 26px;
    color: var(--ink-muted);
    font-size: 12px;
    line-height: 1.6;
}

.secondary-link {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 8px;
    color: var(--white);
    font-weight: 700;
    text-decoration: none;
}

.secondary-link:hover { background: rgba(255, 255, 255, .1); }
.secondary-link:active { background: rgba(255, 255, 255, .18); }

.secondary-link:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

.shell--verify {
    padding-top: max(42px, env(safe-area-inset-top));
}

.verify-heading {
    margin: 0 4px 28px;
    color: var(--white);
}

.verify-heading h1 { font-size: clamp(32px, 8vw, 48px); }

.verify-card {
    width: 100%;
    padding: 38px 32px;
    border-radius: 6px 6px 22px 6px;
    background: var(--white);
    box-shadow: 0 22px 60px rgba(4, 16, 34, .25);
    text-align: center;
}

.verify-card h2 {
    margin: 24px 0 10px;
    font-size: clamp(25px, 6vw, 34px);
    letter-spacing: -.04em;
}

.verify-card > p:not(.result-label, .result-company) {
    margin: 0 auto;
    color: var(--ink-muted);
    line-height: 1.7;
}

.camera-mark {
    position: relative;
    width: 94px;
    height: 72px;
    margin: 0 auto;
    border: 5px solid var(--navy);
    border-radius: 14px;
}

.camera-mark::before {
    content: "";
    position: absolute;
    width: 32px;
    height: 12px;
    top: -16px;
    left: 26px;
    border-radius: 6px 6px 0 0;
    background: var(--navy);
}

.camera-mark span {
    position: absolute;
    width: 34px;
    height: 34px;
    inset: 14px 0 0 25px;
    border: 5px solid var(--blue);
    border-radius: 50%;
}

.verify-result { border-top: 7px solid var(--blue); }

.result-symbol {
    display: grid;
    width: 88px;
    height: 88px;
    margin: 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--ice);
    color: var(--blue);
    font-size: 54px;
    font-weight: 900;
}

.result-label {
    margin: 20px 0 0;
    color: var(--blue);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .16em;
}

.result-company {
    margin: 0 0 14px;
    color: var(--blue);
    font-weight: 800;
}

.result-detail { margin-bottom: 26px !important; }

.verify-result[data-state="valid"] { border-top-color: #1b9a5a; }

.verify-result[data-state="valid"] .result-symbol {
    background: #e0f4e9;
    color: #11663c;
}

.verify-result[data-state="expired"],
.verify-result[data-state="invalid"] { border-top-color: #b33a35; }

.verify-result[data-state="expired"] .result-symbol,
.verify-result[data-state="invalid"] .result-symbol {
    background: #fbe8e6;
    color: #a32f2a;
}

.offline-note {
    margin: 18px 6px 0;
    color: #dce8f7;
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

@media (max-width: 520px) {
    body { background: linear-gradient(165deg, var(--navy) 0 35%, var(--ice) 35% 100%); }
    .shell { padding-inline: 16px; }
    .brand-block { margin-bottom: 34px; }
    .company-panel,
    .message-card { padding: 24px 22px; }
    .company-grid { grid-template-columns: 1fr; }
    .pass-identity {
        display: block;
        padding: 24px 22px 22px 26px;
    }
    .verified-mark { margin-top: 18px; }
    .qr-wrap { padding-inline: 18px; }
    .pass-timer { margin-inline: 22px; }
    .pass-status { padding-inline: 22px; }
    .verify-card { padding: 32px 22px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
