:root {
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #20372e;
    background: #f7f7ef;
    color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .7; }
button:focus-visible, a:focus-visible, input:focus-visible {
    outline: 3px solid #61856b;
    outline-offset: 3px;
}
[hidden] { display: none !important; }

.portal-bar { background: #163e35; color: #fff; }
.portal-bar > div { max-width: 1100px; margin: auto; padding: 18px 32px; display: flex; align-items: center; justify-content: space-between; }
.portal-bar strong { font: 650 24px Bahnschrift, "Segoe UI", sans-serif; letter-spacing: -.7px; }
.portal-bar a { color: #eef5eb; font-size: 14px; text-underline-offset: 4px; padding-block: 5px; }
.page { margin: 0 auto; padding: clamp(24px,7vw,90px) 24px 48px; }
.card { position: relative; max-width: 940px; margin: auto; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); background: #fffefa; border: 1px solid #cdd8c9; border-radius: 18px; overflow: hidden; box-shadow: 0 14px 40px #17382b0c; }
.header { grid-column: 1; grid-row: 1; position: relative; isolation: isolate; overflow: hidden; padding: clamp(26px,4vw,52px); background: #dfecdc; border-right: 1px dashed #aec1aa; }
.service-name { display: block; font-weight: 650; color: #395845; letter-spacing: .02em; margin-bottom: 12px; }
h1 { font: 650 clamp(34px,4.5vw,58px)/1.04 Bahnschrift,"Segoe UI",sans-serif; color: #173e32; letter-spacing: -.045em; overflow-wrap: anywhere; margin: 0; }
.header p { margin: 18px 0 0; color: #395344; line-height: 1.6; max-width: 31ch; }
.ticket-art { width: 112px; height: 56px; margin: 42px 0 0 5px; display:grid; place-items:center; transform: rotate(-7deg); background:#254e40; border-radius:8px; box-shadow:4px 5px #bfd1ba; }
.ticket-art i { width:65%; height:45%; background:repeating-linear-gradient(90deg,#d9ebce 0 2px,transparent 2px 5px,#d9ebce 5px 6px,transparent 6px 9px); }
.summary { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:16px; }
.order-body { grid-column: 2; padding: clamp(24px,4vw,48px); min-width:0; }
.login .order-body { align-self:center; }
.order-body h2 { margin: 0 0 14px; font: 650 21px Bahnschrift,"Segoe UI",sans-serif; color:#203d31; }
.quick-actions { display:grid; gap:9px; margin-bottom:26px; }
.quick-actions .primary { margin:0; }
.details .header { padding-top: 88px; }
.validity, .region-tag {
    display: inline-block;
    border-radius: 20px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 650;
}
.validity, .region-tag.local { background: #edf6ef; color: #286141; }
.validity.expiring, .region-tag { background: #fff4df; color: #80520d; }
.back-form { position: absolute; top: 18px; left: clamp(18px,3vw,42px); z-index:1; }
.back, .copy {
    min-height: 40px;
    padding: 8px;
    border: 0;
    border-radius: 6px;
    color: #375b44;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
}
.back:hover, .copy:hover { background: #e5edde; }
.back span, .primary span { padding-inline: 3px; }
label, .label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.login label { font-size: 12px; }
.text-input, .credential, .region {
    width: 100%;
    min-height: 48px;
    border: 1px solid #bdcbbd;
    background: #fff;
    color: #27212f;
    border-radius: 9px;
}
.text-input { padding: 12px 14px; font-size: 16px; }
.login .text-input { border-color: #ced4da; }
.text-input::placeholder { color: #76717b; }
.primary {
    width: 100%;
    min-height: 46px;
    margin-top: 22px;
    padding: 12px 17px;
    border: 0;
    border-radius: 9px;
    background: #205340;
    color: white;
    font-size: 15px;
    font-weight: 600;
}
.primary:hover { background: #173d30; }
.notice, .code-result {
    margin: 0 0 19px;
    padding: 12px 14px;
    border: 1px solid #edc6cb;
    border-radius: 9px;
    color: #8b3142;
    background: #fff0f1;
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.explanation { margin: 0 0 18px; font-size: 14px; line-height: 1.7; color: #615a6b; }
.fields { display: grid; gap: 17px; }
.profile-note { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: #8b3142; }
.region, .credential { display: flex; align-items: center; gap: 8px; }
.region { justify-content: space-between; flex-wrap: wrap; padding: 8px 13px; }
.credential { padding: 0 5px 0 13px; }
.credential input {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 16px;
    text-overflow: ellipsis;
}
.credential:focus-within { outline: 2px solid #61856b; }
.credential input:focus-visible { outline: 0; }
.code-result { margin: 16px 0 0; background: #edf6ef; border-color: #cde4d5; color: #286141; }
.code-result a { color: #215938; font-weight: 650; }
.credential .code { font-size: 21px; font-weight: 700; letter-spacing: .12em; }
.copy-status { margin: 12px 0 0; color: #51495e; font-size: 13px; }
.copy-status:empty { margin: 0; }
.account-help { margin-top: 16px; text-align: center; }
.account-help a { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; color: #51495e; font-size: 14px; text-underline-offset: 3px; }

@media (max-width: 680px) {
    .portal-bar > div { padding: 14px 20px; }
    .page { padding: 22px 14px 32px; }
    .card { display:block; }
    .header { padding:24px; border:0; border-bottom:1px dashed #aec1aa; }
    .login .header { padding-right:82px; }
    .ticket-art { position:absolute; right:16px; top:24px; width:50px; height:32px; margin:0; }
    .header p { margin-top:10px; }
    .details .header { padding-top:54px; }
    .order-body { padding:22px; }
    .back-form { top:6px; left:15px; }
}
#verification-dialog {
    width: min(390px, calc(100% - 32px));
    padding: 24px;
    border: 1px solid #e4deed;
    border-radius: 18px;
    color: #20372e;
    background: #fff;
    box-shadow: 0 20px 70px #17102344;
}
#verification-dialog::backdrop { background: #1d122c80; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-header h2 { margin: 0; font-size: 21px; letter-spacing: -.5px; }
.dialog-close {
    width: 36px; height: 36px; border: 0; border-radius: 50%;
    color: #51495e; background: #f1eff5; font-size: 24px; line-height: 1;
}
.dialog-body { margin-top: 20px; line-height: 1.5; }
.dialog-loading { display: flex; align-items: center; gap: 12px; color: #51495e; }
.spinner {
    width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%;
    border: 3px solid #dce8ff; border-top-color: #205340; animation: verify-spin .8s linear infinite;
}

.change-account { margin-top: 22px; }
.change-account > summary { display: block; cursor: pointer; padding: 13px; text-align: center; border: 1px solid #bac9b8; border-radius: 9px; font-weight: 650; color: #234836; }
.change-account > summary::-webkit-details-marker { display: none; }
.change-account > summary:focus-visible { outline: 3px solid #61856b; outline-offset: 3px; }
.change-dialog { width: min(440px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 22px; border: 1px solid #bdcbbd; border-radius: 18px; color: #20372e; }
.change-dialog::backdrop { background: #21172c80; }
.change-dialog > .dialog-close { float: right; }
.change-panel { padding-top: 3px; }
.change-panel h2 { margin: 0 44px 15px 0; font-size: 22px; }
.change-panel fieldset { border: 0; padding: 0; margin: 0; }
.change-panel legend { margin-bottom: 12px; font-size: 14px; }
.change-option { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 8px; border: 1px solid #ddd5e4; border-radius: 7px; cursor: pointer; }
.change-option:has(:checked) { background: #e9f3e5; border-color: #6c9873; }
.change-note input { margin-top: 5px; }
.change-actions { display: flex; align-items: center; gap: 12px; margin-top: 15px; }
.change-actions .primary { margin: 0; text-align: center; text-decoration: none; }

@keyframes verify-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.dialog-body .notice, .dialog-body .code-result { margin: 0; }
.dialog-body .code-result a { display: block; padding: 5px 0; }
