:root {
    /* Color Palette */
    --kiosk-h1-color: #0B0B0B;
    --kiosk-text-color: #232323;
    --kiosk-subtitle-color: #5E5E5E;
    --kiosk-input-bg: rgba(255, 255, 255, 0.45);
    --kiosk-lang-switcher-bg: #F2F2FF;
    --kiosk-text-white: #FFFFFF;

    /* Gradients */
    --kiosk-bg-gradient: linear-gradient(180deg, #E8ECF8 0%, #FFFFFF 100%);
    /* --kiosk-btn-check-in-bg: linear-gradient(164deg, #5278C7 0%, #144193 100%); */
    --kiosk-btn-check-in-bg: radial-gradient(circle at 20% 0%, #5278C7 -10%, #144193 78%);
    --kiosk-btn-check-out-bg: linear-gradient(164deg, #6DA4F4 0%, #205AD2 100%);
    --kiosk-active-toggle-bg: linear-gradient(128deg, #ED7B15 0%, #E20313 100%);

    /* Spacing Scale (Vertical Rhythm) */
    --kiosk-space-top-edge: 50px;
    --kiosk-logo-gap-to-h1: 80px;
    --kiosk-h1-gap-to-subtitle: 28px;
    /* --kiosk-subtitle-gap-to-btn: 140px;  */
    --kiosk-subtitle-gap-to-btn: 100px;
    /* --kiosk-btn-gap: 24px; */
    --kiosk-btn-gap: 40px;
    --kiosk-screen-side-padding: 60px;
}

/* Base Isolation & Reset */
html,
body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    /* Default lock */
    font-family: 'Montserrat', sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.kiosk-body {
    /* background: var(--kiosk-bg-gradient); */
    /* Path to your file */
    background-image: url('../images/Background.jpg');
    /* Ensures the SVG covers the whole area without stretching weirdly */
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Scoped Overflow for Usability */
body.kiosk-welcome,
body.kiosk-success {
    overflow: hidden !important;
}

body.kiosk-registration,
body.kiosk-badge-assignment {
    overflow-y: auto !important;
}

/* Hide Symfony Profiler on all Kiosk routes */
.sf-toolbar {
    display: none !important;
}

.kiosk-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 var(--kiosk-screen-side-padding) 80px;
    /* Added 80px bottom safety padding */
    box-sizing: border-box;
}

/* If the body DOES NOT have the .kiosk-welcome class, hide the :before pseudo-element */
body.kiosk-welcome .kiosk-container:before {
    display: none !important;
}

.kiosk-container:before {
    /* This creates the frosted glass look */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* For Safari support */

    /* The subtle background tint (adjust opacity as needed) */
    background: linear-gradient(to bottom,
            rgba(225, 228, 235, 0.6) 0%,
            rgba(235, 240, 255, 0.8) 100%);

    /* Sizing to cover the area */
    width: 100%;
    height: 100%;
    position: absolute;
    bottom: 0;
    content: "";
    z-index: -1;
}

/* Language Toggle */
.kiosk-lang-switcher {
    position: absolute;
    top: var(--kiosk-space-top-edge);
    right: var(--kiosk-screen-side-padding);
    background: var(--kiosk-lang-switcher-bg);
    border-radius: 15px;
    padding: 4px;
    display: flex;
    gap: 4px;
    box-shadow: 55px 55px 60px rgba(0, 0, 0, 0.25);
    z-index: 100;
}

.kiosk-lang-switcher a {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 50px;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 700;
    color: #232323;
    transition: all 0.3s ease;
}

.kiosk-lang-switcher a.active {
    background: var(--kiosk-active-toggle-bg);
    color: var(--kiosk-text-white);
}

/* Logo */
.kiosk-logo-wrapper {
    margin-top: 110px;
    margin-bottom: var(--kiosk-logo-gap-to-h1);
}

.kiosk-logo {
    width: 320px;
    height: 120px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Typography Scale */
.kiosk-header {
    text-align: center;
}

.kiosk-h1 {
    margin: 0;
    color: var(--kiosk-h1-color);
    line-height: normal;
}

.kiosk-h1-small {
    font-size: 50px;
    font-weight: 700;
    /* Bold */
    display: block;
    margin-bottom: 0;
}

.kiosk-h1-large {
    font-size: 50px;
    font-weight: 700;
    /* Extra Bold */
    display: block;
}

/* Registration Title Optimization to stay on one line */
.kiosk-registration .kiosk-h1-large {
    font-size: 48px;
}

.kiosk-subtitle {
    margin: 0;
    margin-top: var(--kiosk-h1-gap-to-subtitle);
    font-size: 28px;
    font-weight: 500;
    /* Medium */
    color: var(--kiosk-subtitle-color);
    max-width: 800px;
    line-height: 1.4;
}

/* Buttons */
.kiosk-actions {
    margin-top: var(--kiosk-subtitle-gap-to-btn);
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--kiosk-btn-gap);
    align-items: center;
}

.kiosk-btn {
    width: 100%;
    min-height: 80px;
    border-radius: 12px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 40px;
    color: var(--kiosk-text-white);
    font-size: 28px;
    font-weight: 600;
    /* SemiBold */
    text-decoration: none;
    box-sizing: border-box;
    transition: transform 0.2s ease, opacity 0.2s ease;
    gap: 16px;
}


.kiosk-btn-check-in {
    background: var(--kiosk-btn-check-in-bg);
    /* box-shadow: 0 10px 20px rgba(20, 65, 147, 0.2); */
    box-shadow: -4.75px 30px 30px rgba(35, 63, 120, 0.25);
    min-height: 130px;
    position: absolute;
    margin: auto;
    bottom: 220px;
    left: 60px;
    right: 60px;
    width: calc(100% - 120px);
}

.kiosk-btn-check-out {
    /* background: var(--kiosk-btn-check-out-bg); */
    /* box-shadow: 0 10px 20px rgba(32, 90, 210, 0.2); */
    background: var(--kiosk-btn-check-in-bg);
    box-shadow: -4.75px 30px 30px rgba(35, 63, 120, 0.25);
    min-height: 130px;
    position: absolute;
    margin: auto;
    bottom: 50px;
    left: 60px;
    right: 60px;
    width: calc(100% - 120px);
}

.kiosk-btn-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

/* --- Wizard & Form Compact Overrides --- */

.kiosk-wizard-step .kiosk-logo-wrapper {
    margin-top: 40px;
    margin-bottom: 40px;
}

.kiosk-wizard-step .kiosk-logo {
    height: 100px;
}

.kiosk-wizard-step .kiosk-reg-form {
    width: 100%;
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.kiosk-reg-row-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.kiosk-purpose-section {
    margin: 0 !important;
}

.kiosk-reg-input-group {
    position: relative;
    width: 100%;
    border-color: transparent !important;
    background: rgb(247 250 250 / 59%) !important;
    border-radius: 12px;
}

.kiosk-reg-input-group:before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: 12px;
    /* 1. The Gradient Background from your screenshot */
    background: linear-gradient(120deg, #FFFFFF 0%, rgba(23, 182, 255, 0.1) 100%) !important;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
}

.kiosk-reg-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    object-fit: contain;
    pointer-events: none;
    opacity: 0.8;
}


.kiosk-reg-input {
    width: 100%;
    height: 65px;
    background: var(--kiosk-input-bg);
    border: none;
    border-radius: 12px;
    padding: 0 20px 0 64px;
    font-family: inherit;
    font-size: 20px;
    font-weight: 500;
    color: var(--kiosk-text-color);
    box-sizing: border-box;
}

.kiosk-purpose-section {
    width: 100%;
    margin-top: 30px;
}

.kiosk-section-label {
    display: block;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    /* Reduced to favor chips visibility */
    color: var(--kiosk-text-color);
}

.kiosk-error-message {
    display: none;
    /* Hidden by default */
    color: #E20313;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    background: rgba(226, 3, 19, 0.05);
    padding: 10px 16px;
    border-radius: 8px;
    border-left: 4px solid #E20313;
}

.kiosk-purpose-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.kiosk-purpose-chip {
    padding: 12px 20px;
    background: #F2F2FF;
    border: 1.5px solid #D0D5E8;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    /* Medium */
    color: var(--kiosk-text-color);
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.kiosk-purpose-chip.active {
    background: var(--kiosk-btn-check-in-bg);
    border-color: transparent;
    color: var(--kiosk-text-white);
    font-weight: 600;
    /* SemiBold */
    box-shadow: 0 4px 10px rgba(20, 65, 147, 0.15);
}

/* Badge Assignment / Scanner Styling */
.kiosk-back-link {
    position: absolute;
    top: 60px;
    left: var(--kiosk-screen-side-padding);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--kiosk-text-color);
    font-size: 20px;
    font-weight: 700;
}

.kiosk-back-icon {
    width: 24px;
    height: 24px;
}

.kiosk-scanner-area {
    margin-top: 180px;
    width: 440px;
    /* Slightly wider to contain the reader + brackets */
    height: 440px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Bracket Logic - Minimal CSS approach for L-brackets */
.kiosk-scanner-frame {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.kiosk-scanner-bracket {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 14px solid #B0B0B0;
    /* Visual Audit estimate ⚠️ */
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

/* Red Alert State */
.kiosk-scanner-frame.error .kiosk-scanner-bracket {
    border-color: #DC2626 !important;
}

.kiosk-bracket-tl {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.kiosk-bracket-tr {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
}

.kiosk-bracket-bl {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
}

.kiosk-bracket-br {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

.kiosk-scanner-line {
    position: absolute;
    left: 20px;
    right: 20px;
    height: 12px;
    background: #8E8E8E;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
    animation: scan-ping-pong 3s ease-in-out infinite;
}

@keyframes scan-ping-pong {
    0% {
        top: 10%;
    }

    50% {
        top: 88%;
    }

    100% {
        top: 10%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kiosk-scanner-line {
        animation: none;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(142, 142, 142, 0.5);
    }
}

#reader {
    width: 380px !important;
    height: 380px !important;
    border: none !important;
    overflow: hidden;
    border-radius: 14px;
    background: #000;
}

#reader video {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
}

/* Suppress html5-qrcode UI */
#reader__dashboard,
#reader__status_span {
    display: none !important;
}

.kiosk-scanner-status-area {
    margin-top: 40px;
    text-align: center;
    max-width: 600px;
}

.kiosk-error-box {
    display: none;
    background: #FEE2E2;
    border: 1.5px solid #DC2626;
    color: #991B1B;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.kiosk-manual-fallback {
    margin-top: 24px;
}

.kiosk-link-fallback {
    color: var(--kiosk-subtitle-color);
    text-decoration: underline;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

.kiosk-manual-input-container {
    display: none;
    margin: 20px auto 0;
    width: 320px;
}

/* Success Screen */
.kiosk-success-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
}

.kiosk-reg-submit-area {
    width: 100%;
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.kiosk-btn-submit {
    width: 50%;
    min-height: 88px;
    position: relative;
    bottom: auto;
    margin: auto;
    left: auto;
    right: auto;
}

.kiosk-btn-submit {
    bottom: 30px;
}

.kiosk-container:before {
    position: fixed;
}