:root {
    --bg: #F8F8F8;
    --surface: #FFFFFF;
    --ink: #000000;
    --ink-desc: #2A2A2A;
    --muted: #AEAEAE;
    --line: rgba(0, 0, 0, 0.08);
    --accent: #000000;
    --accent-soft: rgba(0, 0, 0, 0.06);
    --disabled: #D9D9D9;
    --button-text: #FFFFFF;
    --warn: #D39521;
    --warn-soft: rgba(230, 191, 50, 0.18);
    --danger: #E35633;
    --danger-soft: rgba(227, 86, 51, 0.16);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Heebo", sans-serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0;
    color: var(--ink-desc);
    background: var(--bg);
}

.brand-mark {
    position: fixed;
    top: 28px;
    right: 32px;
    width: min(11vw, 72px);
    height: auto;
    z-index: 2;
}

.app-shell {
    max-width: 720px;
    margin: 0 auto;
    padding: 120px 80px 72px;
}

.context-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.info-table {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 0 12px;
    margin-bottom: 20px;
}

.info-cell {
    background: var(--surface);
    padding: 10px 14px;
    border-radius: 4px;
}

.info-label {
    margin: 0 0 4px;
    font-family: "Roboto Mono", monospace;
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.info-value {
    margin: 0;
    font-family: "Roboto Mono", monospace;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ink);
}

.hero {
    margin-bottom: 20px;
}

h1 {
    margin: 0;
    font-family: "Heebo", sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.05;
    max-width: 20ch;
}

.title-line1 {
    display: block;
    color: var(--muted);
}

.title-line2 {
    display: block;
    color: var(--ink);
}

.subtitle {
    margin: 12px 0 0;
    font-family: "Heebo", sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    color: var(--ink-desc);
    max-width: 32rem;
    line-height: 1.45;
}

.hero-image {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 240px;
    object-fit: contain;
    margin: 20px auto 0;
    border-radius: 8px;
}

.card {
    padding: 0;
}

.survey-panel {
    margin-top: 18px;
    padding: 0;
    border: 0;
    background: transparent;
}

.message {
    margin-top: 20px;
    font-size: 1.08rem;
    line-height: 1.42;
    max-width: 28rem;
    white-space: pre-line;
}

.procedure-panel {
    margin-top: 18px;
}

.procedure-list {
    margin: 0;
    padding-left: 1.1em;
    max-width: 28rem;
    line-height: 1.45;
}

.procedure-list li + li {
    margin-top: 10px;
}

.identity-panel {
    margin-top: 18px;
    border: 0;
    background: transparent;
    padding: 0;
}

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

.identity-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.identity-label {
    font-size: 0.9rem;
    color: var(--muted);
}

.identity-field input {
    width: 100%;
    min-height: 54px;
    border: 1.5px solid var(--muted);
    border-radius: 4px;
    background: var(--surface);
    padding: 12px 14px;
    font-family: "Heebo", sans-serif;
    font-size: inherit;
    color: var(--ink);
}

.identity-field input:focus {
    outline: none;
    border-color: var(--ink);
}

.survey-progress {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.survey-progress-text {
    min-width: 2.5rem;
    font-size: 0.95rem;
    color: var(--muted);
}

.survey-progress-track {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    flex: 1;
}

.survey-progress-segment {
    display: block;
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
}

.survey-progress-segment.active {
    background: var(--ink);
}

.survey-title {
    margin: 0;
    font-size: 1.6rem;
    line-height: 1.15;
    max-width: 28rem;
    margin-bottom: 18px;
}

.choice-row {
    flex-direction: column;
    gap: 10px;
}

.survey-choice,
.secondary {
    width: 100%;
}

.survey-choice {
    justify-content: flex-start;
    text-align: left;
    font-weight: 400;
    min-height: 58px;
}

.survey-choice.selected {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--button-text);
}

.survey-actions {
    justify-content: flex-start;
    align-items: center;
    margin-top: 18px;
}

.dot-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 4px;
    width: 120px;
    height: 120px;
    margin: 10px auto 10px;
}

.dot {
    width: 6px;
    height: 6px;
    background-color: var(--disabled);
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: var(--ink);
}

.timer-display {
    text-align: center;
    font-family: "Heebo", sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--ink);
}

.timer-display span {
    color: var(--ink);
}

.progress-hint {
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 30px;
}

.section-divider {
    border: 0;
    border-top: 1.5px solid var(--line);
    margin: 30px 0;
}

.survey-invitation p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

#take-survey-button {
    background-color: var(--ink);
    color: var(--button-text);
}

.question-number {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.survey-thanks-panel p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.survey-actions {
    margin-top: 30px;
}

#survey-prev-button {
    width: auto;
    min-width: 100px;
    background: transparent;
    border: 1.5px solid var(--muted);
    color: var(--ink-desc);
}

.final-panel .message {
    font-size: 1.1rem;
    margin-top: 0;
}

.choice-row,
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

button {
    border: none;
    border-radius: 6px;
    padding: 16px 20px;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

button:active {
    transform: translateY(1px);
}

.primary {
    width: 100%;
    background: var(--ink);
    color: var(--button-text);
    justify-content: center;
    text-align: center;
    min-height: 58px;
}

.primary:disabled,
.primary.disabled {
    background: var(--disabled);
    cursor: not-allowed;
}

.secondary {
    flex: 1;
    min-width: 140px;
    background: transparent;
    border: 1.5px solid var(--muted);
    color: var(--ink-desc);
}

#survey-back-button {
    width: auto;
    min-height: auto;
    min-width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.9rem;
}

.secondary:hover,
.secondary:focus-visible {
    background: var(--accent-soft);
}

.primary:hover:not(:disabled),
.primary:focus-visible:not(:disabled) {
    opacity: 0.9;
}

.hidden {
    display: none !important;
}

.warn {
    background: var(--warn-soft);
    color: var(--warn);
    border-color: var(--warn);
}

.danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger);
}

@media (max-width: 640px) {
    .brand-mark {
        position: static;
        display: block;
        width: min(20vw, 56px);
        margin: 20px 14px 0 auto;
    }

    .app-shell {
        padding: 20px 24px 48px;
    }

    .info-table {
        gap: 0 8px;
    }

    .primary,
    .secondary {
        width: 100%;
    }
}
