:root {
    --vb-green: #76b38f;
    --bs-primary: #76b38f;
    --bs-primary-rgb: 118, 179, 143;
}

html, body {
    font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
    background: #f5f5f5;
}

/* Bootstrap primary override */
.btn-primary {
    background-color: var(--vb-green);
    border-color: var(--vb-green);
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: #5fa178;
    border-color: #5fa178;
}
a, .rules-link {
    color: var(--vb-green);
}

/* Language toggling: hide all language texts by default, show those matching body class */
[class^="lang-text-"], [class*=" lang-text-"] { display: none; }
body.lang-it .lang-text-it,
body.lang-gb .lang-text-gb,
body.lang-de .lang-text-de,
body.lang-fr .lang-text-fr { display: inline; }

/* Splash */
.splash {
    position: fixed;
    inset: 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity .4s ease;
}
.splash.hidden { opacity: 0; pointer-events: none; }
.logo-loading {
    text-align: center;
    padding: 1.5rem;
    max-width: 90vw;
}
.splash-logo {
    display: block;
    width: 100%;
    max-width: 420px;
    height: auto;
    margin: 0 auto 1rem;
}
.pass-text {
    color: var(--vb-green);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 1.5rem;
}
.splash-hint {
    color: #6c757d;
    font-size: .9rem;
    margin-bottom: .5rem;
    text-transform: lowercase;
    letter-spacing: .5px;
}
.flags-cont {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: .4rem;
}
.splash-hint {
    flex: 0 0 100%;
    text-align: center;
    margin-bottom: .25rem;
}
.flag {
    flex: 0 0 auto;
    width: clamp(40px, 13vw, 72px);
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
    cursor: pointer;
    transition: transform .15s ease;
}
.flag:hover { transform: scale(1.08); }

/* Screens */
.screen {
    min-height: calc(100vh - 60px);
    transition: transform .4s ease;
}
.screen-2 {
    display: none;
}
body.screen-2-visible .screen-1 { display: none; }
body.screen-2-visible .screen-2 { display: block; }

/* Empty state: nessun prodotto in vendita (strada chiusa) */
.road-closed-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .08);
    border: 1px solid #eee;
    max-width: 460px;
    width: 100%;
}
.road-closed-badge {
    width: 96px;
    height: 96px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff3cd;
    color: #d39e00;
}
.road-closed-badge i {
    font-size: 3rem;
    line-height: 1;
}
.road-closed-title {
    font-weight: 700;
    color: #495057;
    letter-spacing: .5px;
}
.road-closed-sub {
    font-size: .95rem;
}

/* Codice manuale (fallback se il lettore al varco non funziona) */
.manual-code-box {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}
.manual-code-value {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: .35rem;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

/* Product cards */
.product-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    padding: 1.5rem;
    cursor: pointer;
    text-align: center;
    transition: transform .15s ease, box-shadow .15s ease;
    height: 100%;
}
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.product-card .prod-title {
    font-weight: 700;
    text-transform: uppercase;
    color: #444;
    margin-bottom: .75rem;
}
.product-card .prod-price {
    color: var(--vb-green);
    font-weight: 700;
    font-size: 2rem;
}

/* Back button */
.back-link {
    text-decoration: none;
    color: var(--vb-green);
    display: inline-flex;
    align-items: center;
}
.back-link .material-icons { font-size: 1.1rem; }

.s2-title {
    color: var(--vb-green);
    font-weight: 700;
    text-transform: uppercase;
}

.end-date-display {
    background: #f8f9fa;
}

/* Steps indicator */
.steps-cont {
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 50;
}
.step {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0,0,0,.15);
}
.step.current-step {
    background: var(--vb-green);
    width: 24px;
    border-radius: 5px;
}

/* Complete screen */
.complete-screen .circle {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--vb-green);
    color: #fff;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.complete-screen .circle-icon { font-size: 60px; }
.complete-text { color: var(--vb-green); font-weight: 700; }

/* Pagina annullo */
.cancel-screen .circle-warn { background: #d9534f; }
.cancel-text { color: #d9534f; font-weight: 700; }

/* QR di accesso al varco mostrato dopo pagamento OK */
.qr-block .qr-title { color: var(--vb-green); font-weight: 700; }
.qr-block .qr-img {
    width: 280px;
    max-width: 80vw;
    height: auto;
    border: 4px solid #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
    border-radius: 8px;
    background: #fff;
}
.qr-block .qr-meta {
    font-family: monospace;
    font-size: 1.1rem;
    color: #333;
}
.qr-block .btn-outline-success {
    color: var(--vb-green);
    border-color: var(--vb-green);
}
.qr-block .btn-outline-success:hover {
    background-color: var(--vb-green);
    border-color: var(--vb-green);
    color: #fff;
}
