:root {
    --primary: #003366; /* DCF Navy */
    --accent: #ffcc00;  /* NJ Gold */
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ff8c00;
    --gray: #6c757d;
    --bg-light: #f8f9fa;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    /* overflow: hidden moved to .kiosk-bg so admin pages can scroll */
}

.kiosk-bg {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden; /* Prevent kiosk from being scrollable */
    padding: 16px;
    box-sizing: border-box;
}

.kiosk-container {
    width: 90%;
    max-width: 800px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.12);
    position: relative;
    padding: 40px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease-in-out;
    /* Height is content-driven on mobile; capped on desktop */
    max-height: 90vh;
    overflow: hidden;
}

/* State Management */
.state {
    display: none;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
}

.state.active {
    display: flex;
}

/* Idle State */
.kiosk-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.kiosk-hero h1 {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.kiosk-hero p {
    font-size: 1.6rem;
    color: var(--gray);
}

.dcf-brand-logo {
    max-width: 75%;
    height: auto;
    margin-bottom: 1.5rem;
}

.dcf-brand-logo-small {
    max-width: 25%;
    height: auto;
    margin-bottom: 0.8rem;
}

.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.scanner-icon {
    margin-top: 1.5rem;
    color: var(--primary);
    flex-shrink: 0;
}

/* Results State */
.user-name {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.device-details {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 15px;
    width: 100%;
    margin-bottom: 1.5rem;
    text-align: left;
    box-sizing: border-box;
}

.detail-row {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.detail-row .label {
    font-weight: bold;
    color: var(--gray);
    width: 150px;
    display: inline-block;
}

.question-container h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

/* Buttons */
.button-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
}

.btn {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 1.2rem 0.8rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.1s, filter 0.2s;
    text-transform: uppercase;
    color: white;
}

.btn:active {
    transform: scale(0.95);
}

.btn-yes    { background-color: var(--success); }
.btn-no     { background-color: var(--warning); }
.btn-unsure { background-color: var(--primary); }
.btn-cancel { background-color: var(--gray); }

/* Edit State */
.edit-card {
    width: 100%;
    text-align: left;
}

.edit-card h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.edit-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 1rem;
}

.edit-group {
    margin-bottom: 1rem;
}

.edit-group label {
    display: block;
    font-size: 1.3rem;
    color: var(--gray);
    margin-bottom: 0.3rem;
    font-weight: bold;
}

.kiosk-input, .kiosk-select {
    width: 100%;
    font-size: 1.5rem;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: white;
    box-sizing: border-box;
}

.kiosk-input:focus, .kiosk-select:focus {
    border-color: var(--primary);
    outline: none;
}

/* Utils */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mt-4 { margin-top: 1rem; }

.check-icon, .alert-icon {
    margin-bottom: 2rem;
}

/* ── Mobile Responsiveness ─────────────────────────── */

@media (max-width: 600px) {
    .kiosk-bg {
        align-items: flex-start;
        padding: 12px;
    }

    .kiosk-container {
        width: 100%;
        max-width: 100%;
        padding: 24px 20px;
        border-radius: 16px;
        max-height: none;
    }

    .kiosk-hero h1 {
        font-size: 1.6rem;
        margin-bottom: 0.3rem;
    }

    .kiosk-hero p {
        font-size: 1rem;
    }

    .dcf-brand-logo {
        max-width: 60%;
        margin-bottom: 1rem;
    }

    .dcf-brand-logo-small {
        max-width: 40%;
    }

    .scanner-icon svg {
        width: 70px;
        height: 70px;
    }

    .scanner-icon {
        margin-top: 1rem;
    }

    .user-name {
        font-size: 1.8rem;
        margin-bottom: 0.6rem;
    }

    .detail-row {
        font-size: 1rem;
    }

    .detail-row .label {
        width: 100px;
    }

    .device-details {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .question-container h3 {
        font-size: 1.2rem;
        margin-bottom: 0.6rem;
    }

    .btn {
        font-size: 1rem;
        padding: 0.9rem 0.4rem;
        border-radius: 10px;
    }

    .button-grid {
        gap: 8px;
    }

    .edit-card h2 {
        font-size: 1.4rem;
    }

    .edit-row-grid {
        grid-template-columns: 1fr; /* Stack first/last name on mobile */
        gap: 0;
    }

    .edit-group label {
        font-size: 1rem;
    }

    .kiosk-input, .kiosk-select {
        font-size: 1.1rem;
        padding: 0.6rem;
    }

    .check-icon, .alert-icon {
        margin-bottom: 1rem;
    }

    .check-icon svg, .alert-icon svg {
        width: 70px;
        height: 70px;
    }
}
