:root {
    color-scheme: only light;
    --bg: #f1f4f8;
    --card: #ffffff;
    --text: #1c2430;
    --muted: #5c6b7c;
    --accent: #1668c7;
    --green: #1d9e55;
    --green-dark: #178246;
    --red: #c8362f;
    --radius: 18px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    touch-action: manipulation;
}

.kiosk {
    width: 100%;
    max-width: 640px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(20, 40, 70, 0.12);
    padding: 40px 44px 44px;
}

.kiosk-header {
    text-align: center;
    margin-bottom: 32px;
}

.kiosk-header h1 {
    font-size: 2.4rem;
    margin-bottom: 8px;
}

.kiosk-header p {
    font-size: 1.25rem;
    color: var(--muted);
}

.field {
    margin-bottom: 22px;
}

.field label {
    display: block;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.field .optional {
    font-weight: 400;
    color: var(--muted);
    font-size: 1.05rem;
}

.input {
    width: 100%;
    font-size: 1.7rem;
    padding: 16px 18px;
    min-height: 64px;
    border: 2px solid #ccd6e2;
    border-radius: 12px;
    background: #fafcfe;
    color: var(--text);
    outline: none;
}

.input:focus {
    border-color: var(--accent);
    background: #fff;
}

.input.invalid {
    border-color: var(--red);
}

.input-reg {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
}

.input-comment {
    font-size: 1.3rem;
    resize: none;
    min-height: 110px;
}

.field-error,
.form-error {
    color: var(--red);
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 8px;
}

.form-error {
    text-align: center;
    margin-bottom: 16px;
}

.save-button {
    width: 100%;
    min-height: 84px;
    font-size: 1.9rem;
    font-weight: 700;
    color: #fff;
    background: var(--green);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    margin-top: 8px;
}

.save-button:active {
    background: var(--green-dark);
}

.save-button:disabled {
    opacity: 0.6;
}

/* --- Tack-overlay --- */

.thanks-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fade-in 0.35s ease-out;
}

.thanks-overlay[hidden] {
    display: none;
}

.thanks-content {
    text-align: center;
    padding: 24px;
}

.thanks-content h2 {
    font-size: 2.8rem;
    margin: 28px 0 12px;
}

.thanks-content p {
    font-size: 1.5rem;
    color: var(--muted);
}

.thanks-check {
    width: 140px;
    height: 140px;
    stroke: var(--green);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.thanks-check-circle {
    stroke-dasharray: 158;
    stroke-dashoffset: 158;
    animation: draw 0.6s ease-out forwards;
}

.thanks-check-mark {
    stroke-dasharray: 36;
    stroke-dashoffset: 36;
    animation: draw 0.4s 0.45s ease-out forwards;
}

@keyframes draw {
    to { stroke-dashoffset: 0; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mindre skärmar / stående surfplatta */
@media (max-width: 480px) {
    .kiosk {
        padding: 28px 22px 30px;
    }

    .kiosk-header h1 {
        font-size: 1.9rem;
    }

    .kiosk-header p {
        font-size: 1.1rem;
    }
}
