:root {
    --body-bg: #080808;
    --app-bg: #080808;
    --card-bg: #141414;
    --card-bg-2: #1a1a1a;
    --primary-accent: #e8001a;
    --primary-accent-hover: #ff1a30;
    --primary-accent-glow: rgba(232, 0, 26, 0.25);
    --primary-accent-subtle: rgba(232, 0, 26, 0.08);
    --text-main: #f0f0f0;
    --text-muted: #888;
    --border-subtle: rgba(255, 255, 255, 0.07);
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.6);
    --shadow-red: 0 4px 20px rgba(232, 0, 26, 0.3);
    --radius-lg: 20px;
    --radius-md: 14px;
    --transition-base: all 0.25s ease-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--body-bg);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

/* ─── SPLASH SCREEN ───────────────────────────────────── */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1a0005 0%, #080808 70%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

.splash-logo {
    margin-bottom: 20px;
    animation: pulse 2s infinite;
    filter: drop-shadow(0 0 20px rgba(232, 0, 26, 0.5));
}

.splash-logo-img {
    height: 120px;
    width: auto;
}

#splash-screen h2 {
    color: var(--primary-accent);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 1px;
}

#splash-screen p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 40px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(232, 0, 26, 0.15);
    border-top-color: var(--primary-accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.12);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── LAYOUT ──────────────────────────────────────────── */
.app-container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    background-color: var(--app-bg);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ─── HEADER ──────────────────────────────────────────── */
header {
    position: relative;
    padding: 55px 25px 35px 25px;
    text-align: center;
    overflow: hidden;
}

.header-bg-gradient {
    position: absolute;
    top: -30%;
    left: -10%;
    width: 120%;
    height: 150%;
    background: radial-gradient(ellipse at 50% 30%, #e8001a 0%, transparent 65%);
    opacity: 0.15;
    filter: blur(50px);
    z-index: 0;
}

.header-content {
    position: relative;
    z-index: 1;
}

.logo-container {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #1e1e1e, #2a0008);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 15px auto;
    box-shadow: var(--shadow-red), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(232, 0, 26, 0.4);
}

.header-logo-img {
    height: 50px;
    width: auto;
}

.logo-icon {
    font-size: 36px;
}

header h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff 30%, var(--primary-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.header-tag {
    display: inline-block;
    margin-top: 12px;
    background: var(--primary-accent-subtle);
    border: 1px solid rgba(232, 0, 26, 0.3);
    color: var(--primary-accent);
    padding: 5px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ─── MAIN ────────────────────────────────────────────── */
main {
    flex: 1;
    padding: 10px 20px 30px 20px;
}

.section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 18px;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* ─── STEPS ───────────────────────────────────────────── */
.hidden-step {
    display: none !important;
    opacity: 0;
}

.active-step {
    display: block;
    animation: fadeIn 0.4s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

/* ─── DATE SELECTOR STRIP ─────────────────────────────── */
.date-selector-strip {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 15px;
    margin-bottom: 5px;
    scrollbar-width: none;
}

.date-selector-strip::-webkit-scrollbar {
    display: none;
}

.date-card {
    min-width: 65px;
    flex: 0 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 14px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s ease;
}

.date-card:active {
    transform: scale(0.95);
}

.date-day-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 3px;
}

.date-number {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 3px;
}

.date-month-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--primary-accent);
    text-transform: uppercase;
}

.date-card.active {
    background: var(--primary-accent);
    border-color: var(--primary-accent);
    box-shadow: 0 8px 20px rgba(232, 0, 26, 0.3);
}

.date-card.active .date-day-name,
.date-card.active .date-number,
.date-card.active .date-month-name {
    color: #fff;
}

/* ─── SLOTS CONTAINER ─────────────────────────────────── */
.slots-container-wrapper {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-subtle);
    min-height: 250px;
}

.day-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.day-content.active-day {
    display: block;
}

.fascia-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin: 0 0 12px 2px;
    display: block;
    font-weight: 700;
}

.slots-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 25px;
}

.slots-grid:last-child {
    margin-bottom: 0;
}

.slot-pill {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 12px;
    border-radius: 12px;
    text-align: center;
    color: var(--primary-accent);
    font-weight: 700;
    font-size: 15px;
    transition: 0.2s;
    cursor: pointer;
    letter-spacing: 0.5px;
}

.slot-pill:hover {
    border-color: var(--primary-accent);
    background: var(--primary-accent-subtle);
    transform: scale(1.02);
}

.slot-pill:active {
    background: var(--primary-accent);
    color: #fff;
    border-color: var(--primary-accent);
    transform: scale(0.97);
    box-shadow: var(--shadow-red);
}

.compact-slots-wrapper {
    min-height: 0;
    padding: 14px;
}

.slot-select-card {
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 14px;
    margin-bottom: 12px;
}

.slot-select-card:last-child {
    margin-bottom: 0;
}

.slot-select-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.fascia-label.compact {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
    letter-spacing: 0.4px;
}

.slot-count {
    color: var(--primary-accent);
    background: var(--primary-accent-subtle);
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.slot-window {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 10px;
}

.slot-select-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 8px;
}

.slot-time-select {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: #111;
    color: var(--text-main);
    padding: 12px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    outline: none;
}

.slot-time-select:focus {
    border-color: var(--primary-accent);
}

.slot-select-button {
    border: 0;
    border-radius: 10px;
    background: var(--primary-accent);
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-red);
}

.slot-select-button:active {
    transform: scale(0.96);
}

.booking-day-panel {
    display: block;
}

.booking-day-head {
    border: 1px solid rgba(232, 0, 26, 0.18);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(232, 0, 26, 0.13), rgba(255, 255, 255, 0.03));
    padding: 14px;
    margin-bottom: 14px;
}

.booking-kicker {
    display: block;
    color: var(--primary-accent);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

.booking-day-head h3 {
    color: var(--text-main);
    font-size: 18px;
    line-height: 1.25;
    margin-bottom: 4px;
    text-transform: capitalize;
}

.booking-day-head p {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}

.booking-section-label {
    color: var(--text-main);
    font-size: 13px;
    font-weight: 800;
    margin: 2px 2px 10px;
}

.booking-slots-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.booking-time-divider {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin: 8px 2px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.booking-time-divider:first-child {
    margin-top: 0;
}

.booking-time-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--border-subtle);
}

.booking-slot-chip {
    min-width: 0;
    min-height: 62px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-main);
    padding: 9px 6px;
    font-family: 'Poppins', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    transition: 0.18s ease;
}

.booking-slot-chip strong {
    color: var(--text-main);
    font-size: 15px;
    line-height: 1;
}

.booking-slot-chip span {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
}

.booking-slot-chip:hover {
    border-color: var(--primary-accent);
    background: var(--primary-accent-subtle);
}

.booking-slot-chip:active {
    transform: scale(0.96);
    background: var(--primary-accent);
    border-color: var(--primary-accent);
}

.booking-slot-chip:active strong,
.booking-slot-chip:active span {
    color: #fff;
}

.booking-empty-slots {
    grid-column: 1 / -1;
    border: 1px dashed var(--border-subtle);
    border-radius: 10px;
    padding: 18px 12px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

@media (min-width: 520px) {
    .booking-slots-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ─── RECAP & FORM ────────────────────────────────────── */
.recap-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0005 100%);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 25px;
    border: 1px solid rgba(232, 0, 26, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.recap-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.recap-card h3 {
    color: var(--primary-accent);
    font-size: 18px;
    margin-top: 6px;
    font-weight: 700;
}

#form-prenotazione {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Floating label inputs */
.input-floating-group {
    position: relative;
}

.input-floating-group input,
.input-floating-group select,
.input-floating-group textarea {
    width: 100%;
    padding: 20px 15px 8px 15px;
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 16px;
    outline: none;
    transition: var(--transition-base);
    font-family: 'Poppins', sans-serif;
}

.input-floating-group textarea {
    padding-top: 22px;
    line-height: 1.5;
}

.input-floating-group select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.input-floating-group label {
    position: absolute;
    left: 15px;
    top: 15px;
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    transition: var(--transition-base);
}

.input-floating-group input:focus,
.input-floating-group input:not(:placeholder-shown),
.input-floating-group textarea:focus,
.input-floating-group textarea:not(:placeholder-shown) {
    border-color: var(--primary-accent);
    background-color: rgba(232, 0, 26, 0.03);
    box-shadow: 0 0 0 3px rgba(232, 0, 26, 0.08);
}

.input-floating-group input:focus+label,
.input-floating-group input:not(:placeholder-shown)+label,
.input-floating-group textarea:focus+label,
.input-floating-group textarea:not(:placeholder-shown)+label,
.input-floating-group select:focus+label,
.input-floating-group select:valid+label {
    top: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-accent);
    letter-spacing: 0.5px;
}

.select-label {
    top: 15px;
}

.hidden-element {
    display: none;
}

/* ─── BUTTONS ─────────────────────────────────────────── */
.action-buttons-container {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

button {
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Poppins', sans-serif;
}

.btn-primary {
    flex: 2;
    background: linear-gradient(135deg, var(--primary-accent), #c0000f);
    color: #fff;
    padding: 18px;
    box-shadow: var(--shadow-red);
    letter-spacing: 0.5px;
}

.btn-primary:active {
    background: var(--primary-accent-hover);
    transform: scale(0.97);
    box-shadow: none;
}

.btn-secondary {
    flex: 1;
    background-color: var(--card-bg);
    color: var(--text-main);
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:active {
    transform: scale(0.97);
}

/* ─── SUCCESS ─────────────────────────────────────────── */
.success-icon {
    font-size: 70px;
    margin-bottom: 15px;
    animation: successPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 0 20px rgba(232, 0, 26, 0.4));
}

@keyframes successPop {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ─── PWA BANNER ──────────────────────────────────────── */
#pwa-install-banner {
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 28px);
    max-width: 450px;
    background: var(--card-bg);
    border: 1px solid rgba(232, 0, 26, 0.3);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.48);
    z-index: 9999;
    animation: slideUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.pwa-icon {
    font-size: 28px;
    margin-right: 12px;
}

.pwa-text {
    flex: 1;
    min-width: 0;
}

.pwa-text strong {
    color: var(--primary-accent);
    font-size: 13px;
    display: block;
    line-height: 1.2;
}

.pwa-text p {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
    line-height: 1.25;
}

.pwa-install-action {
    padding: 8px 11px;
    font-size: 12px;
    margin-left: 0;
    box-shadow: none;
    flex-shrink: 0;
}

.pwa-close-action {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

@keyframes slideUp {
    from {
        bottom: -100px;
        opacity: 0;
    }

    to {
        bottom: 14px;
        opacity: 1;
    }
}

/* Bottone whatsapp in alto */
.whatsapp-container-top {
    margin-top: -20px;
    /* Sposta il bottone su */
    margin-bottom: 25px;
    /* Spazio tra il tastino e il titolo "Seleziona un giorno..." */
    display: flex;
    justify-content: center;
}

.btn-whatsapp-compact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(37, 211, 102, 0.1);
    /* Verde scuro trasparente */
    border: 1px solid rgba(37, 211, 102, 0.3);
    /* Bordino verde leggero */
    color: #25D366;
    /* Testo verde WhatsApp */
    padding: 5px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

.btn-whatsapp-compact i {
    font-size: 16px;
    /* Icona piccolina proporzionata al testo */
}

/* Effetto quando viene cliccato */
.btn-whatsapp-compact:active {
    background: #25D366;
    color: #fff;
    transform: scale(0.97);
}
