:root {
    color-scheme: light;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #172b27;
    background: #f2f7f4;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }

.page {
    min-height: 100vh;
    padding: clamp(20px, 5vw, 56px) 16px;
    background: radial-gradient(circle at top left, #d8eee2 0, transparent 38%), #f2f7f4;
}
.shell { width: min(100%, 780px); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 0 22px 4px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: #08704b; color: #fff; font-size: 25px; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: -.02em; }
.brand small { color: #5d766c; font-size: 12px; }

.card { padding: clamp(24px, 5vw, 42px); border: 1px solid #e0ebe4; border-radius: 24px; background: #fff; box-shadow: 0 22px 55px rgba(24, 64, 44, .09); }
.eyebrow { margin: 0 0 9px; color: #08704b; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(28px, 5vw, 37px); line-height: 1.15; letter-spacing: -.035em; }
.intro { margin: 15px 0 19px; color: #4e665c; line-height: 1.6; }
.notice { margin: 17px 0; padding: 13px 16px; border: 1px solid #cce8d6; border-radius: 13px; background: #ecf8f0; color: #245b3e; font-size: 14px; line-height: 1.5; }

.registration-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0 24px; padding: 0; list-style: none; }
.registration-steps li { min-width: 0; padding: 10px 11px; border: 1px solid #dce8df; border-radius: 11px; background: #f6faf7; color: #617a6c; font-size: 13px; font-weight: 700; line-height: 1.3; }
.registration-steps li[aria-current="step"] { border-color: #08704b; background: #e5f7ea; color: #075d3f; }
.registration-steps li[data-complete="true"] { border-color: #bddfca; color: #08704b; }
.registration-steps li[data-complete="true"]::before { content: "✓ "; }

.form-status, .face-status { padding: 12px 14px; border-radius: 11px; background: #f1f5f3; color: #3d584b; font-size: 14px; line-height: 1.5; }
.form-status { margin: 0 0 24px; }
.face-status { margin: 8px 0 14px; }
.attempt-status { margin: -5px 0 14px; padding: 10px 12px; border-left: 4px solid #e3a635; border-radius: 8px; background: #fff8e7; color: #694c12; font-size: 13px; line-height: 1.45; }
.submit-result { margin: 10px 0 0; }
.form-status[data-state="error"], .face-status[data-state="error"] { background: #fff1ed; color: #a0392b; }
.form-status[data-state="busy"], .face-status[data-state="busy"] { background: #eaf3fa; color: #225374; }
.form-status[data-state="success"], .face-status[data-state="success"] { background: #e5f7ea; color: #146237; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { margin-bottom: 17px; }
.field label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #bdcfc4; border-radius: 10px; background: #fff; color: #172b27; font: inherit; }
.field textarea { resize: vertical; }
.field input[type="file"] { padding: 10px; font-size: 14px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .consent input:focus-visible, .voice-choice input:focus-visible, .button:focus-visible, a:focus-visible { outline: 3px solid #e3a635; outline-offset: 2px; border-color: #08704b; }
.section-heading { margin: 30px 0 12px; font-size: 19px; letter-spacing: -.02em; }
.field-help { margin: 7px 0 15px; color: #617a6c; font-size: 13px; line-height: 1.5; }

.face-section { margin: 25px 0 23px; padding: clamp(16px, 3vw, 24px); border: 1px solid #cde5d5; border-radius: 17px; background: #f8fcf9; }
.face-section h2 { margin: 0 0 7px; font-size: 19px; letter-spacing: -.02em; }
.face-section .field { margin-top: 20px; }
.camera { position: relative; overflow: hidden; width: min(100%, 520px); aspect-ratio: 4 / 3; border-radius: 15px; background: #10231d; }
.camera video { display: block; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera-placeholder { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; color: #c5d9d0; text-align: center; font-size: 14px; }
.camera-prompt { position: absolute; right: 0; bottom: 0; left: 0; min-height: 58px; display: grid; place-items: center; padding: 12px 18px; background: rgba(3, 19, 13, .8); color: #fff; text-align: center; font-size: clamp(16px, 3.5vw, 22px); font-weight: 750; }
.step { margin: 14px 0 0; color: #08704b; font-size: 13px; font-weight: 750; }
.voice-choice { display: flex; align-items: center; gap: 9px; width: fit-content; margin: 0 0 13px; color: #385749; font-size: 13px; font-weight: 650; cursor: pointer; }
.voice-choice input { width: 18px; height: 18px; margin: 0; accent-color: #08704b; }
.ktp-camera { margin: 18px 0; padding: 14px; border: 1px solid #cde5d5; border-radius: 14px; background: #f3faf6; }
.ktp-camera video, .ktp-camera canvas { display: block; width: 100%; max-height: 420px; border-radius: 11px; background: #10231d; object-fit: contain; }
.ktp-camera [hidden] { display: none !important; }
.ktp-camera p { margin: 10px 0; color: #385749; font-size: 13px; line-height: 1.5; }
.ktp-camera-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; color: #385749; font-size: 13px; line-height: 1.5; }
.consent input { width: 18px; height: 18px; flex: 0 0 18px; margin: 1px 0 0; accent-color: #08704b; }

.button { min-height: 48px; padding: 11px 18px; border-radius: 11px; font: inherit; font-weight: 750; cursor: pointer; }
.button-primary { width: 100%; border: 0; background: #08704b; color: #fff; }
.button-outline { border: 1px solid #08704b; background: #fff; color: #08704b; }
.button-primary:hover:not(:disabled) { background: #075d3f; }
.button-outline:hover:not(:disabled) { background: #e7f6ec; }
.button:disabled { cursor: wait; opacity: .65; }
.button.is-loading { display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.button-spinner { width: 18px; height: 18px; flex: 0 0 18px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: button-spin .75s linear infinite; }
@keyframes button-spin { to { transform: rotate(360deg); } }
.submit-button { margin-top: 5px; }
.help { margin-top: 25px; padding-top: 20px; border-top: 1px solid #e7eee9; font-size: 14px; }
a { color: #08704b; font-weight: 650; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #06482f; }
.footer { margin: 17px 0 0; color: #758b7e; text-align: center; font-size: 12px; }

@media (max-width: 600px) {
    .page { padding: 14px 12px 28px; }
    .brand { margin: 5px 0 15px 3px; }
    .card { border-radius: 19px; }
    .field-grid { grid-template-columns: 1fr; gap: 0; }
    .face-section { border-radius: 13px; }
    .camera { border-radius: 11px; }
    .camera-prompt { min-height: 64px; }
    .button-outline { width: 100%; }
    .registration-steps { gap: 5px; margin: 15px 0 19px; }
    .registration-steps li { padding: 8px 6px; text-align: center; font-size: 11px; }
}
