:root {
    color-scheme: light;
    --brand: #d9e41f;
    --brand-hover: #c6d019;
    --brand-soft: #f8fad8;
    --brand-dark: #000000;
    --text: #111111;
    --muted: #5a5a5a;
    --border: #d1d1d1;
    --surface: #ffffff;
    --page: #f5f5f5;
    --danger: #c4314b;
    --success: #d9e41f;
    font-family: "Segoe UI", SegoeUI, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 80% 12%, rgba(217, 228, 31, .14), transparent 28rem),
        var(--page);
}

button, input, select { font: inherit; }

.page-shell {
    width: min(100% - 32px, 760px);
    margin: 0 auto;
    padding: 48px 0 32px;
}

.form-card {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.accent { height: 10px; background: var(--brand); }

.form-header {
    display: flex;
    padding: 38px 44px 30px;
    border-bottom: 1px solid #ededed;
}

.eyebrow {
    margin: 0 0 8px;
    color: #000;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .11em;
}

.eyebrow::after {
    content: "";
    display: inline-block;
    width: 28px;
    height: 5px;
    margin-left: 9px;
    background: var(--brand);
    border-radius: 999px;
    vertical-align: 2px;
}

h1 {
    margin: 0;
    font-size: clamp(27px, 5vw, 38px);
    font-weight: 600;
    letter-spacing: -.025em;
    line-height: 1.15;
}

.intro {
    max-width: 550px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.5;
}

.mode-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 44px 0;
    padding: 12px 14px;
    color: #111;
    background: var(--brand-soft);
    border-radius: 4px;
    font-size: 14px;
}

.mode-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #000;
    box-shadow: 0 0 0 4px rgba(217, 228, 31, .65);
}

form { padding: 12px 44px 38px; }

.question {
    padding: 25px 0 26px;
    border-bottom: 1px solid #ededed;
}

.question > label, legend, .question-title {
    display: block;
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.question > label > span[aria-hidden="true"], legend > span[aria-hidden="true"], .required-note span { color: var(--danger); }

.hint {
    margin: 7px 0 15px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }

input, select {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    color: var(--text);
    background: #fff;
    border: 1px solid #8a8886;
    border-radius: 2px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

select { appearance: none; padding-right: 42px; cursor: pointer; }
select:disabled { color: #777; background: #f4f4f4; cursor: wait; }

.select-wrap { position: relative; max-width: 460px; }
.select-wrap::after {
    content: "";
    position: absolute;
    top: 16px;
    right: 16px;
    width: 8px;
    height: 8px;
    border-right: 2px solid #555;
    border-bottom: 2px solid #555;
    transform: rotate(45deg);
    pointer-events: none;
}

input[type="date"] { max-width: 240px; }

input:focus, select:focus {
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(217, 228, 31, .6);
}

input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }

.server-clock {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-top: 14px;
}

.server-clock-time {
    font-size: clamp(32px, 6vw, 44px);
    font-weight: 650;
    letter-spacing: -.035em;
    line-height: 1;
}

.server-clock-date { color: var(--muted); font-size: 14px; }
.server-hint { margin-bottom: 0; }

.punch-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 520px;
}

.punch-option-wrap { position: relative; }
.punch-option-wrap input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.punch-option {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 84px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #8a8886;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s, transform .15s;
}

.punch-option:hover { border-color: #000; background: #fbfbf4; }
.punch-option-wrap input:focus-visible + .punch-option { box-shadow: 0 0 0 3px rgba(217, 228, 31, .65); }
.punch-option-wrap input:checked + .punch-option {
    color: #000;
    background: var(--brand);
    border-color: #000;
    box-shadow: inset 0 0 0 1px #000;
}

.punch-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    color: var(--brand);
    background: #000;
    border-radius: 50%;
    font-size: 22px;
    font-weight: 700;
}

.punch-option strong, .punch-option small { display: block; }
.punch-option strong { font-size: 16px; }
.punch-option small { margin-top: 4px; color: var(--muted); font-size: 13px; }
.punch-option-wrap input:checked + .punch-option small { color: #272727; }

.field-error {
    min-height: 18px;
    margin: 7px 0 0;
    color: var(--danger);
    font-size: 13px;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: 28px;
}

.submit-button, .secondary-button {
    min-width: 112px;
    min-height: 42px;
    padding: 9px 22px;
    border: 0;
    border-radius: 2px;
    cursor: pointer;
    font-weight: 600;
}

.submit-button { color: #000; background: var(--brand); border: 1px solid #000; }
.submit-button:hover:not(:disabled) { color: var(--brand); background: #000; }
.submit-button:disabled { color: #999; background: #e1e1e1; cursor: not-allowed; }
.submit-button:focus-visible, .secondary-button:focus-visible { outline: 3px solid rgba(217, 228, 31, .7); outline-offset: 2px; }

.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0,0,0,.25);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.submit-button.is-loading .button-label { display: none; }
.submit-button.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.required-note { margin: 0; color: var(--muted); font-size: 13px; }

.result-panel { padding: 54px 44px 58px; text-align: center; }
.result-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 20px;
    color: #000;
    background: var(--success);
    border-radius: 50%;
    font-size: 28px;
}
.result-panel h2 { margin: 0; font-size: 25px; font-weight: 600; }
.result-panel p { margin: 12px auto 24px; color: var(--muted); line-height: 1.5; }
.secondary-button { color: #000; background: white; border: 1px solid #000; }
.secondary-button:hover { background: var(--brand-soft); }

.privacy-note { margin: 18px 0 0; color: #777; font-size: 12px; text-align: center; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 10;
    width: min(calc(100% - 32px), 560px);
    padding: 14px 18px;
    color: white;
    background: #3b3a39;
    border-radius: 4px;
    box-shadow: 0 6px 24px rgba(0,0,0,.24);
    transform: translateX(-50%);
    font-size: 14px;
}

@media (max-width: 600px) {
    .page-shell { width: min(100% - 20px, 760px); padding-top: 20px; }
    .form-header { padding: 28px 22px 24px; }
    .mode-banner { margin: 18px 22px 0; }
    form { padding: 8px 22px 28px; }
    .server-clock { align-items: flex-start; flex-direction: column; gap: 7px; }
    .punch-options { grid-template-columns: 1fr; }
    .form-actions { align-items: flex-start; flex-direction: column-reverse; gap: 16px; }
    .submit-button { width: 100%; }
    .result-panel { padding: 42px 22px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; }
}
