/* =================================================================
   STUDIO MEDICO IPPOCRATE - BRANDED STYLESHEET
   ================================================================= */

/* --- CRITICAL VARIABLES & RESET --- */
:root {
    color-scheme: light dark;

    /* New Brand Identity Colors */
    --primary: #1a2f4c;        /* Navy Blue */
    --primary-dark: #0f1a2a;   /* Darker Navy */
    --primary-light: #285078;  /* Lighter Blue */
    --accent: #c29b57;         /* Elegant Gold */
    --bg-gradient-1: #f3efe6;  /* Cream Background */
    --bg-gradient-2: #e8e2d2;  /* Slightly darker cream */
    --text-dark: #1a2f4c;      /* Navy text for high contrast */
    --text-medium: #4a5568;
    --white: #ffffff;
    --border-color: #d1c7b3;   /* Cream border */
    --shadow-md: 0 8px 24px rgba(26, 47, 76, 0.12);
    --radius-lg: 12px;         /* Sharper borders for classic look */
    --radius-md: 8px;
    --danger: #dc2626;         /* Emergency Red */
    --warning: #c29b57;        /* Gold */
    
    /* New Brand Fonts */
    --font-sans: 'Montserrat', sans-serif;
    --font-serif: 'Playball', cursive;
}

/* Dark Mode Variables (Navy & Gold Theme) */
body.dark-mode {
    --primary: #1f3659;        /* Deep Navy for UI elements to maintain contrast */
    --primary-dark: #e0b976;   /* Gold for headings */
    --primary-light: #2a4a73;  /* Lighter blue for active states */
    --accent: #e0b976;         /* Bright Gold */
    --bg-gradient-1: #0a1628;  /* Very Dark Navy */
    --bg-gradient-2: #11223a;  /* Standard Navy */
    --text-dark: #f3efe6;      /* Cream text */
    --text-medium: #cbd5e1;
    --white: #162438;          /* Card backgrounds */
    --border-color: #285078;
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth; 
    font-size: 18px; 
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(180deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

body.modal-open { overflow: hidden; }

/* --- LINKS & ACCESSIBILITY --- */
a { text-decoration: none; color: inherit; transition: opacity 0.2s, transform 0.2s; }
a:hover { opacity: 0.9; }
a:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.skip-link {
    position: absolute; top: -40px; left: 0;
    background: var(--primary); color: var(--accent);
    padding: 8px; z-index: 100;
    transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* --- HEADER / LANDING PAGE --- */
header {
    background-color: var(--primary); 
    color: var(--white);
    padding: 80px 20px 120px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
}

header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(26, 47, 76, 0.85); /* Navy overlay */
    z-index: 1;
}

body.dark-mode header::after { background: rgba(10, 22, 40, 0.9); }

.header-content { position: relative; z-index: 2; max-width: 900px; margin: 0 auto; }

header h1 { 
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 400; margin-bottom: 5px; 
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    line-height: 1.2; color: #ffffff;
}

header p { 
    font-size: clamp(1rem, 2vw, 1.1rem);
    font-weight: 500; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.9); margin-bottom: 25px;
}

.btn-telefono-header {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 10px; background-color: var(--primary); color: var(--accent) !important;
    border: 2px solid var(--accent);
    font-size: 1.2rem; font-weight: 700; padding: 15px 30px;
    border-radius: 50px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, background-color 0.2s, color 0.2s; text-shadow: none;
}
.btn-telefono-header:hover { 
    background-color: var(--accent); 
    color: var(--primary) !important;
    transform: translateY(-2px); 
    opacity: 1; 
}
.btn-telefono-header:active { transform: scale(0.96); }

/* --- LANGUAGE SWITCHER --- */
.lang-switch {
    position: absolute; top: 20px; right: 20px; z-index: 20;
    background: rgba(26, 47, 76, 0.5); backdrop-filter: blur(5px);
    padding: 5px 15px; border-radius: 20px; border: 1px solid var(--accent);
    display: flex; gap: 10px; align-items: center;
}

.lang-btn {
    background: none; border: none; color: rgba(255, 255, 255, 0.7);
    font-weight: 600; cursor: pointer; font-size: 0.9rem;
    transition: color 0.3s; padding: 5px 8px;
}

.lang-btn:hover { color: var(--accent); }
.lang-btn.active { color: var(--accent); }
.lang-separator { color: rgba(255,255,255,0.3); }

/* --- LAYOUT GRID --- */
.container {
    max-width: 1100px; margin: -60px auto 60px; padding: 0 20px;
    display: grid; grid-template-columns: 1fr; gap: 25px; position: relative; z-index: 10;
}

@media (min-width: 900px) { .container { grid-template-columns: 2fr 1fr; } }

/* --- CARDS --- */
.card {
    background: var(--white); padding: 30px; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md); border: 1px solid var(--border-color);
    margin-bottom: 25px; transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(26, 47, 76, 0.15); }
body.dark-mode .card:hover { box-shadow: 0 12px 30px rgba(194, 155, 87, 0.1); }

.card-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px; padding-bottom: 15px; border-bottom: 2px solid var(--bg-gradient-1);
}

.card-header i { 
    font-size: 1.4rem; color: var(--accent); 
    background: var(--primary); padding: 10px; border-radius: 8px;
}

h2 { font-size: clamp(1.2rem, 3vw, 1.4rem); font-weight: 700; color: var(--primary-dark); }
body.dark-mode h2 { color: var(--accent); }


/* --- BUTTONS & ACTIONS --- */
.millebook-wrapper { margin-bottom: 25px; text-align: center; }

.btn-millebook {
    background: var(--primary-light);
    width: 100%; padding: 30px; border-radius: var(--radius-lg);
    color: white; box-shadow: 0 8px 20px rgba(40, 80, 120, 0.25);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s; border: 2px solid var(--accent);
}

.btn-millebook:hover { transform: translateY(-4px); box-shadow: 0 12px 25px rgba(40, 80, 120, 0.35); }
.btn-millebook:active { transform: scale(0.98); box-shadow: 0 4px 10px rgba(40, 80, 120, 0.2); }
.btn-millebook i { font-size: 2.5rem; margin-bottom: 10px; color: var(--accent); }
.btn-millebook span { font-size: clamp(1.1rem, 3vw, 1.4rem); font-weight: 700; letter-spacing: 0.5px; }
.btn-millebook small { font-size: 1rem; opacity: 0.9; margin-top: 5px; font-weight: 500; }

.action-grid { display: grid; grid-template-columns: 1fr; gap: 15px; }
@media (min-width: 600px) { .action-grid { grid-template-columns: 1fr 1fr; } }

.btn-main {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 20px; border-radius: var(--radius-lg); text-align: center; border: none; cursor: pointer; width: 100%;
    transition: transform 0.2s, box-shadow 0.2s; color: white; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.btn-main:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); color: white;}
.btn-main:active { transform: scale(0.98); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

.btn-prenota { background: var(--primary); border: 2px solid var(--accent); color: var(--accent); } 
.btn-prenota:hover { background: var(--accent); color: var(--primary); }
.btn-app { background: var(--primary-light); border: 1px solid var(--accent); }

/* Banner FAQ */
.faq-banner-btn {
    background: var(--primary);
    border: 2px solid var(--accent);
    color: var(--accent);
    flex-direction: row; gap: 10px; padding: 18px;
    justify-content: center;
}
.faq-banner-btn:hover { background: var(--accent); color: var(--primary); }
.faq-banner-btn i { font-size: 1.5rem; margin: 0 !important; }
.faq-banner-btn span { font-weight: 700; font-size: 1.15rem; }

/* --- CALENDAR CUSTOM BUTTONS --- */
.cal-services-grid {
    display: grid; grid-template-columns: 1fr; gap: 15px; margin-top: 20px;
}
.btn-cal-service {
    display: flex; align-items: center; justify-content: flex-start; gap: 15px;
    background: var(--white); border: 2px solid var(--border-color);
    padding: 15px 20px; border-radius: var(--radius-lg); text-align: left;
    transition: all 0.2s ease; box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    color: var(--text-dark); text-decoration: none;
}
.btn-cal-service:hover {
    border-color: var(--accent); transform: translateY(-2px);
    box-shadow: var(--shadow-md); opacity: 1; color: var(--text-dark);
}
.btn-cal-service.prima { border-left: 6px solid var(--primary); }
.btn-cal-service.ordinaria { border-left: 6px solid var(--accent); }
.btn-cal-service.breve { border-left: 6px solid var(--danger); }

.cal-icon-wrapper {
    width: 45px; height: 45px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}
.btn-cal-service.prima .cal-icon-wrapper { background: var(--bg-gradient-1); color: var(--primary); }
.btn-cal-service.ordinaria .cal-icon-wrapper { background: #fdfaf4; color: var(--accent); }
.btn-cal-service.breve .cal-icon-wrapper { background: #fff0f0; color: var(--danger); }

body.dark-mode .btn-cal-service { background: var(--bg-gradient-2); color: var(--text-dark); }
body.dark-mode .btn-cal-service:hover { color: var(--text-dark); }
body.dark-mode .btn-cal-service.prima .cal-icon-wrapper { background: #0f1a2a; color: var(--accent); }
body.dark-mode .btn-cal-service.ordinaria .cal-icon-wrapper { background: #1a2f4c; color: var(--accent); }
body.dark-mode .btn-cal-service.breve .cal-icon-wrapper { background: #2d1a1a; color: #ff6b6b; }

.cal-text h3 { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--text-dark); }
.cal-text p { margin: 4px 0 0; font-size: 0.85rem; color: var(--text-medium); line-height: 1.3; }

/* --- NOTICES & HIGHLIGHTS --- */
.notice-transfer { background: #fffbeb; border-left: 4px solid var(--accent); padding: 15px; border-radius: 8px; }
.notice-transfer .step-icon { background: #fdfaf4; color: var(--accent); }
.notice-transfer h3 { color: var(--primary); }
.notice-transfer p { color: var(--primary-dark); font-weight: bold; font-size: 1.05rem; }

body.dark-mode .notice-transfer { background: var(--bg-gradient-2); border-left-color: var(--accent); }
body.dark-mode .notice-transfer .step-icon { background: var(--primary); color: var(--accent); }
body.dark-mode .notice-transfer h3, body.dark-mode .notice-transfer p { color: var(--accent); }

.alert-box {
    background-color: var(--bg-gradient-1); border-left: 5px solid var(--accent);
    padding: 20px; margin-bottom: 25px; border-radius: 8px;
    color: var(--text-dark); font-size: clamp(0.9rem, 2vw, 1rem);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); line-height: 1.6;
}
body.dark-mode .alert-box { background-color: var(--bg-gradient-2); }
.alert-box p { margin-bottom: 10px; }
.alert-box p:last-child { margin-bottom: 0; }
body.dark-mode .alert-box p strong { color: #e4e6eb; }

/* --- ALERTS & URGENCY --- */
.urgency-wrapper { margin-top: 30px; margin-bottom: 25px; }

.alert-emergency {
    background-color: #fff0f0; border: 2px solid var(--danger); color: var(--danger);
    padding: 20px; border-radius: var(--radius-lg); text-align: center;
    font-weight: 600; display: flex; align-items: center; justify-content: center;
    gap: 15px; box-shadow: var(--shadow-md); font-size: clamp(0.9rem, 2vw, 1rem);
}
body.dark-mode .alert-emergency { background-color: #2d1a1a; color: #ff6b6b; border-color: #ff6b6b; }
.alert-emergency i { font-size: 1.8rem; color: inherit; flex-shrink: 0; }

/* --- CONTACTS & TABLES --- */
.contact-row {
    display: flex; align-items: center; gap: 15px; margin-bottom: 15px; padding: 12px;
    background: var(--bg-gradient-1); border-radius: 10px;
    border: 1px solid var(--border-color); transition: background 0.2s ease;
}
.contact-row:hover { background: #fdfaf4; border-color: var(--accent); }
body.dark-mode .contact-row:hover { background: var(--bg-gradient-2); }

.icon-circle {
    width: 36px; height: 36px; background: var(--primary);
    color: var(--accent); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); flex-shrink: 0;
}

.contact-label { font-size: 0.8rem; text-transform: uppercase; color: var(--text-medium); font-weight: 700; display: block; }
.contact-value { font-size: 1.1rem; font-weight: 700; display: block; }

.hours-table { width: 100%; border-collapse: collapse; }
.hours-table td { padding: 8px 0; border-bottom: 1px solid var(--border-color); font-size: 0.95rem; }
.hours-table tr:last-child td { border-bottom: none; }
.hours-table .day { font-weight: 700; color: var(--primary); }
body.dark-mode .hours-table .day { color: var(--accent); }
.hours-table .time { text-align: right; color: var(--text-dark); font-weight: 700; }
.hours-table .closed-day { color: var(--danger); }

/* --- TRIAGE SECTION --- */
.triage-options {
    display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 20px;
}
@media (min-width: 600px) { .triage-options { grid-template-columns: 1fr 1fr; } }
.triage-option {
    background: var(--bg-gradient-1); border: 2px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 25px 20px;
    text-align: center; display: flex; flex-direction: column; justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}
.triage-option:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); }
body.dark-mode .triage-option { background: var(--bg-gradient-2); }
.triage-icon { font-size: 3rem; margin-bottom: 15px; }
.triage-option h3 { color: var(--primary); margin-bottom: 10px; font-size: 1.25rem; font-weight: 700; }
body.dark-mode .triage-option h3 { color: var(--accent); }
.triage-option p { font-size: 0.95rem; color: var(--text-medium); margin-bottom: 25px; line-height: 1.5; }

/* --- MODALS (WELCOME & REPS) --- */
#welcome-overlay, #reps-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(26, 47, 76, 0.85); backdrop-filter: blur(5px);
    z-index: 10000; display: flex; justify-content: center; align-items: center;
    padding: 20px; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s;
}

body.dark-mode #welcome-overlay, body.dark-mode #reps-overlay { background-color: rgba(0, 0, 0, 0.9); }
#welcome-overlay.active, #reps-overlay[style*="display: flex"] { opacity: 1; visibility: visible; }

.welcome-card, .reps-card {
    background: var(--white); width: 100%; max-width: 700px;
    max-height: 90vh; overflow-y: auto; border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative; display: flex; flex-direction: column; border: 2px solid var(--accent);
}
.reps-card { max-width: 500px; padding: 30px; text-align: center; }

.welcome-header {
    background: var(--primary);
    border-bottom: 4px solid var(--accent);
    color: white; padding: 30px; text-align: center; border-radius: 18px 18px 0 0;
}
.welcome-header h2 { color: var(--accent); margin: 0; font-size: 1.8rem; font-family: var(--font-serif); }
.welcome-body { padding: 30px; color: var(--text-dark); background: var(--bg-gradient-1); }
.welcome-step { margin-bottom: 25px; display: flex; gap: 15px; align-items: flex-start; }

.step-icon {
    background: var(--primary); color: var(--accent); width: 40px; height: 40px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}

.step-content h3 { font-size: 1.1rem; color: var(--primary); margin-bottom: 5px; font-weight: 700;}
body.dark-mode .step-content h3 { color: var(--accent); }
.step-content p { font-size: 0.95rem; color: var(--text-medium); margin-bottom: 0; }

.welcome-footer {
    padding: 20px 30px 30px; text-align: center; border-top: 1px solid var(--border-color); 
    background: var(--white); border-radius: 0 0 18px 18px; position: sticky; bottom: 0;
}

.btn-accept, .btn-reps-close {
    background: var(--primary); color: var(--accent); border: 2px solid var(--accent); padding: 15px 40px;
    border-radius: 50px; font-size: 1.1rem; font-weight: 700; cursor: pointer;
    box-shadow: 0 4px 15px rgba(26, 47, 76, 0.3); transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    display: inline-flex; align-items: center; gap: 10px; justify-content: center;
}
.btn-accept:hover, .btn-reps-close:hover {
    background: var(--accent); color: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(194, 155, 87, 0.4);
}
.btn-accept:active, .btn-reps-close:active { transform: scale(0.98); }

/* --- FLOATING FAQ BUTTON --- */
.floating-faq {
    position: fixed; bottom: 30px; right: 30px;
    background-color: var(--primary); color: var(--accent); border-radius: 50px;
    padding: 15px 25px; display: flex; align-items: center; gap: 10px;
    box-shadow: 0 6px 20px rgba(26, 47, 76, 0.4); z-index: 9999;
    font-weight: 700; font-size: 1.1rem; border: 2px solid var(--accent);
    transition: transform 0.3s, box-shadow 0.3s;
}
.floating-faq:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(194, 155, 87, 0.6);
    background-color: var(--accent); color: var(--primary); opacity: 1;
}
@media (max-width: 768px) {
    .floating-faq { bottom: 20px; right: 20px; padding: 12px 18px; border-width: 2px;}
    .floating-faq-text { display: none; }
    .floating-faq i { font-size: 1.5rem; margin: 0; }
}

/* --- FOOTER & UTILS --- */
footer {
    text-align: center; padding: 40px 20px; font-size: 0.85rem;
    color: var(--text-medium); background: var(--primary); border-top: 4px solid var(--accent);
}
.footer-content { max-width: 1000px; margin: 0 auto; color: white;}
footer a { color: var(--accent); font-weight: bold; }

.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.5s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.privacy-notice {
    margin-top: 20px; padding: 15px; background: var(--bg-gradient-1);
    border-radius: 8px; border: 1px solid var(--border-color); font-size: 0.9rem;
}
.privacy-notice a { color: var(--primary); text-decoration: underline; font-weight: bold;}
.privacy-notice a:hover { color: var(--accent); }

/* --- WELCOME MODAL: EMERGENCY STEP DARK MODE FIX --- */
.welcome-step-emergency {
    background-color: #fff0f0;
    border-left: 4px solid var(--danger);
    padding: 15px;
    border-radius: 4px;
}
body.dark-mode .welcome-step-emergency {
    background-color: #2d1a1a;
    border-left-color: #ff6b6b;
}
body.dark-mode .welcome-step-emergency h3 { color: #ff6b6b; }
body.dark-mode .welcome-step-emergency p { color: #cbd5e1; }
body.dark-mode .welcome-step-emergency p strong { color: #f3efe6; }
body.dark-mode .welcome-step-emergency p b { color: #ff6b6b; }

/* --- DARK MODE TEXT CONTRAST UTILITY --- */
.text-primary { 
    color: var(--primary); 
}
body.dark-mode .text-primary { 
    color: var(--accent) !important; 
}
body.dark-mode .btn-cal-service.prima .cal-icon-wrapper {
    color: var(--accent);
}

/* --- DARK MODE: INLINE STYLE OVERRIDES --- */
/* Triage section uses inline color: var(--primary-light) which is dark navy in dark mode */
body.dark-mode .triage-icon { color: var(--accent) !important; }
body.dark-mode .triage-option h3 { color: var(--accent) !important; }
body.dark-mode .triage-option .btn-main { background: var(--primary-light) !important; }

/* Booking guide heading */
body.dark-mode .booking-guide h3 { color: var(--accent) !important; }

/* Contact value with inline color: var(--primary) */
body.dark-mode .contact-value { color: var(--text-dark) !important; }

/* Inline h3 colors using var(--primary) */
body.dark-mode .card h3[style*="color: var(--primary)"] { color: var(--accent) !important; }

/* --- SIDEBAR LOGO --- */
.sidebar-logo-container {
    text-align: center;
    padding: 20px 0 10px;
}
.sidebar-logo-img {
    max-width: 120px;
    height: auto;
    border-radius: 12px;
    opacity: 0.92;
    filter: drop-shadow(0 2px 8px rgba(26, 47, 76, 0.2));
    transition: opacity 0.3s;
}
body.dark-mode .sidebar-logo-img {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
    opacity: 0.85;
}

/* --- BTN PRENOTA LARGE (shared by index + ferie) --- */
.btn-prenota-large {
    background: var(--primary);
    width: 100%; padding: 30px; border-radius: var(--radius-lg);
    color: var(--accent); box-shadow: 0 8px 20px rgba(26, 47, 76, 0.25);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    border: 2px solid var(--accent);
    text-align: center; cursor: pointer;
}
.btn-prenota-large:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(194, 155, 87, 0.35);
    background: var(--accent);
    color: var(--primary);
}
.btn-prenota-large:hover i { color: var(--primary); }
.btn-prenota-large:active { transform: scale(0.98); box-shadow: 0 4px 10px rgba(26, 47, 76, 0.2); }
.btn-prenota-large i { font-size: 2.5rem; margin-bottom: 10px; color: var(--accent); transition: color 0.2s; }
.btn-prenota-large span { font-size: clamp(1.1rem, 3vw, 1.4rem); font-weight: 700; letter-spacing: 0.5px; }
.btn-prenota-large small { font-size: 1rem; opacity: 0.9; margin-top: 5px; font-weight: 500; }

/* --- MOBILE APP BANNER (index only, hidden on desktop) --- */
.mobile-app-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    padding: 13px 24px;
    font-weight: 700;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-align: center;
    width: 100%;
    position: relative;
    z-index: 1000;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.mobile-app-banner:hover {
    background: linear-gradient(135deg, var(--accent) 0%, #a37c38 100%);
    color: var(--primary);
    border-bottom-color: var(--primary);
    opacity: 1;
}
.mobile-app-banner i { font-size: 1rem; }
.mobile-app-banner .banner-arrow { font-size: 0.65rem; opacity: 0.75; }
@media (min-width: 768px) { .mobile-app-banner { display: none !important; } }

/* --- NOTICE: READ FAQ (welcome modal) --- */
.notice-readfaq {
    background: #eff6ff;
    border-left: 4px solid var(--primary-light);
    padding: 15px;
    border-radius: 8px;
}
.notice-readfaq .step-icon { background: var(--primary-light); color: white; }
.notice-readfaq h3 { color: var(--primary); }
body.dark-mode .notice-readfaq { background: var(--bg-gradient-2); border-left-color: var(--primary-light); }
body.dark-mode .notice-readfaq h3 { color: var(--accent); }

/* --- OPEN/CLOSED BADGE --- */
.badge-open, .badge-closed {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-left: 10px;
    vertical-align: middle;
}
.badge-open {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.badge-closed {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
body.dark-mode .badge-open { background: #1a3a22; color: #7ecf8e; border-color: #2a5a32; }
body.dark-mode .badge-closed { background: #3a1a1e; color: #f08090; border-color: #5a2a30; }
.badge-open i, .badge-closed i { font-size: 0.5rem; }

/* --- FERIE BANNER --- */
#ferie-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #dce8f5;
    color: #0f1e2e;
    border-bottom: 2px solid #285078;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
    z-index: 999;
    flex-wrap: wrap;
}
#ferie-banner i { flex-shrink: 0; font-size: 1.1rem; color: #285078; }
#ferie-banner span { flex: 1; min-width: 0; }
#ferie-banner-close {
    background: none;
    border: 1px solid #285078;
    color: #285078;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
body.dark-mode #ferie-banner { background: #0d1e30; color: #a8c8e8; border-bottom-color: #285078; }
body.dark-mode #ferie-banner i { color: #a8c8e8; }
body.dark-mode #ferie-banner-close { border-color: #a8c8e8; color: #a8c8e8; }

/* --- FLOWCHART --- */
.flow-question-card, .flow-end-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 2px solid var(--border-color);
    animation: fadeIn 0.2s ease;
}
.flow-end-card { border-width: 2px; }
.flow-question { font-size: 1.1rem; font-weight: 700; color: var(--text-dark); margin-bottom: 14px; }
.flow-options { display: flex; flex-direction: column; gap: 10px; }
.flow-option-btn {
    background: var(--bg-gradient-1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
}
.flow-option-btn:hover { background: var(--accent); border-color: var(--accent); color: var(--primary); }
.flow-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    font-weight: 600;
}
body.dark-mode .flow-warning { background: #3a2e00; color: #ffd060; border-color: #ffc107; }
.flow-end-icon { font-size: 2rem; margin-bottom: 10px; }
.flow-end-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.flow-end-desc { color: var(--text-medium); margin-bottom: 16px; font-size: 0.95rem; }
.flow-action-btn {
    display: inline-block;
    background: var(--primary);
    color: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 10px;
    transition: opacity 0.15s;
}
.flow-action-btn:hover { opacity: 0.85; }
.flow-restart-btn {
    background: none;
    border: none;
    color: var(--text-medium);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 0;
    display: block;
    margin-top: 6px;
}
.flow-restart-btn:hover { color: var(--primary); }

/* --- FAQ SEARCH --- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.faq-search-wrapper { margin-bottom: 20px; }
.faq-search-inner {
    position: relative;
    display: flex;
    align-items: center;
}
.faq-search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-medium);
    font-size: 0.95rem;
    pointer-events: none;
}
#faq-search {
    width: 100%;
    padding: 12px 16px 12px 38px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-family: var(--font-sans);
    background: var(--white);
    color: var(--text-dark);
    box-sizing: border-box;
    transition: border-color 0.2s;
}
#faq-search:focus {
    outline: none;
    border-color: var(--accent);
}
body.dark-mode #faq-search { background: var(--bg-gradient-2); color: var(--text-dark); }

/* --- CHECKLIST --- */
/* Reset <button> browser defaults without breaking existing .btn-cal-service layout */
.btn-cal-service {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    /* padding and width already set by the existing .btn-cal-service rule — do not override here */
}
.btn-cal-service.selected {
    outline: 3px solid var(--accent);
    border-radius: var(--radius-lg);
}
.checklist-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}
.checklist-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.checklist-items li label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.4;
}
.checklist-items li input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}
body.dark-mode .checklist-title { color: var(--accent); }
body.dark-mode .btn-cal-service.selected { outline-color: var(--accent); }

/* =================================================================
   TASK A — ACCESSIBILITY: REDUCED MOTION + FOCUS VISIBLE
   ================================================================= */

/* Disable non-essential animations/transitions for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Keyboard-visible focus ring for all interactive elements */
button:focus-visible,
[role="button"]:focus-visible,
.btn-prenota-large:focus-visible,
.btn-millebook:focus-visible,
.btn-accept:focus-visible,
.btn-reps-close:focus-visible,
.lang-btn:focus-visible,
.flow-option-btn:focus-visible,
.flow-action-btn:focus-visible,
.flow-restart-btn:focus-visible,
.floating-faq:focus-visible,
.contact-row:focus-visible,
.mobile-app-banner:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Dark mode: flow option buttons readable text */
body.dark-mode .flow-option-btn { color: var(--text-dark); }
body.dark-mode .flow-option-btn:hover { color: var(--primary-dark); }
body.dark-mode .flow-restart-btn:hover { color: var(--accent); }

/* =================================================================
   TASK B — MOBILE QUICK ACTIONS BAR
   ================================================================= */

.quick-actions-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: var(--primary);
    border-top: 2px solid var(--accent);
    padding: 6px 4px env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.35);
}

@media (max-width: 768px) {
    .quick-actions-bar { display: flex; justify-content: space-around; align-items: center; }
    /* Body padding so content is not hidden behind the bar */
    body { padding-bottom: 74px; }
    /* Lift floating FAQ above the quick-actions bar */
    .floating-faq { bottom: 84px; }
}

body.dark-mode .quick-actions-bar {
    background: var(--bg-gradient-2);
    border-top-color: var(--accent);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.6);
}

.qa-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 8px;
    color: rgba(255,255,255,0.75);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: color 0.2s, background 0.2s;
    text-decoration: none;
    min-width: 52px;
    text-align: center;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
}
.qa-item i { font-size: 1.2rem; color: var(--accent); transition: color 0.2s; display: block; }
.qa-item:hover, .qa-item:active { color: var(--accent); background: rgba(194,155,87,0.12); opacity: 1; }
.qa-item:hover i, .qa-item:active i { color: #ffffff; }
.qa-item:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* =================================================================
   TASK D — SW UPDATE TOAST
   ================================================================= */

#sw-update-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: var(--primary);
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--font-sans);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    white-space: nowrap;
    pointer-events: none;
}
#sw-update-toast.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
#sw-update-toast .sw-toast-btn {
    background: var(--accent);
    color: var(--primary);
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: opacity 0.2s;
    font-family: var(--font-sans);
}
#sw-update-toast .sw-toast-btn:hover { opacity: 0.85; }
body.dark-mode #sw-update-toast { background: var(--bg-gradient-2); }
@media (max-width: 768px) { #sw-update-toast { bottom: 84px; font-size: 0.8rem; } }
@media (prefers-reduced-motion: reduce) { #sw-update-toast { transition: opacity 0.01ms; } }

/* =================================================================
   ANDROID PAGE SPECIFIC STYLES
   ================================================================= */

.is-android-page {
    --bg-body: #f3efe6;
    --bg-card: #ffffff;
    --bg-header: rgba(26, 47, 76, 0.95);
    --header-height: 65px;
    --text-muted: var(--text-medium);
}

body.dark-mode.is-android-page {
    --bg-body: #0a1628;
    --bg-card: #11223a;
    --bg-header: rgba(10, 22, 40, 0.95);
}

/* Android modal overlay */
.is-android-page .modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(26,47,76,0.85); z-index: 2000;
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.is-android-page .modal-content {
    background: var(--bg-card); width: 100%; max-width: 400px;
    border-radius: 16px; padding: 25px; border: 2px solid var(--accent); color: var(--text-dark);
}
.is-android-page .btn-accept {
    background: var(--primary); color: var(--accent); border: 2px solid var(--accent);
    padding: 12px 30px; border-radius: 50px; font-weight: 700; width: 100%;
    font-size: 1rem; margin-top: 15px; text-align: center; cursor: pointer;
    font-family: var(--font-sans);
}

/* Logo theme switching */
.is-android-page .logo-dark { display: none; }
body.dark-mode.is-android-page .logo-dark { display: block; }
body.dark-mode.is-android-page .logo-light { display: none; }

.is-android-page {
    background-color: var(--bg-body);
    padding: var(--header-height) 0 80px 0;
}

.is-android-page header {
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    position: fixed; top: 0; left: 0; right: 0; height: var(--header-height);
    z-index: 100; padding: 0 15px; border-bottom: 2px solid var(--accent);
    display: flex; justify-content: space-between; align-items: center;
    text-align: left;
}

.is-android-page header::after { display: none; }

.is-android-page .brand { display: flex; align-items: center; gap: 12px; }
.is-android-page .brand-logo { width: 40px; height: 40px; border-radius: 8px; }
.is-android-page .brand h1 { margin: 0; font-family: 'Playball', cursive; font-size: 1.4rem; color: var(--accent); text-shadow: none; }
.is-android-page .brand p { margin: 0; font-size: 0.65rem; color: #ffffff; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; text-shadow: none; }

.is-android-page .hero-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--primary); color: var(--accent) !important; border: 2px solid var(--accent);
    padding: 25px; border-radius: 12px; text-align: center; margin-bottom: 20px; width: 100%;
}
.is-android-page .hero-btn i { font-size: 2.5rem; margin-bottom: 10px; }
.is-android-page .hero-btn h2 { margin: 0; font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.is-android-page .hero-btn p { margin: 5px 0 0; font-size: 0.9rem; color: white;}

.is-android-page .grid-buttons { display: grid; grid-template-columns: 1fr; gap: 15px; margin-bottom: 20px; }
.is-android-page .action-btn { background: var(--bg-card); border: 2px solid var(--accent); padding: 18px 10px; border-radius: 12px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-dark); font-weight: bold; }
.is-android-page .action-btn i { font-size: 1.4rem; color: var(--accent); background: var(--primary); padding: 12px; border-radius: 50%; }

.is-android-page .link-item { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--border-color); color: var(--text-dark); }
.is-android-page .link-item .icon { width: 36px; height: 36px; background: var(--primary); color: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-right: 15px; }
.is-android-page .link-item .label { display: block; font-size: 0.75rem; color: var(--text-medium); font-weight: bold; text-transform: uppercase;}
.is-android-page .link-item .val { display: block; font-weight: 700; font-size: 1rem; }

.is-android-page .bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; height: 64px;
    background: var(--bg-card); border-top: 2px solid var(--border-color);
    display: flex; justify-content: space-around; align-items: center;
    z-index: 100; padding-bottom: env(safe-area-inset-bottom, 0);
}
.is-android-page .nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.65rem; font-weight: 700; color: var(--text-medium); padding: 8px 12px; }
.is-android-page .nav-item.active { color: var(--accent); }

/* Android Splash */
.is-android-page #splash-screen {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999;
    background: var(--primary); display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 20px; transition: opacity 0.4s ease;
}
.is-android-page #splash-screen.fade-out { opacity: 0; pointer-events: none; }
.is-android-page #splash-screen img { width: 140px; height: auto; border-radius: 20px; }
.is-android-page #splash-screen .splash-name { font-family: 'Playball', cursive; font-size: 2.2rem; color: var(--accent); }

body.dark-mode.is-android-page #splash-screen { background: #0a1628; }
body.dark-mode.is-android-page .hero-btn { background: #1f3659; }
body.dark-mode.is-android-page .action-btn i,
body.dark-mode.is-android-page .link-item .icon { background: #1f3659; }

/* =================================================================
   LARGE TEXT ACCESSIBILITY MODE
   ================================================================= */

/* Banner */
#large-text-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #f0f4f8;
    border-bottom: 3px solid #d1d5db;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: #555;
    gap: 12px;
    transition: background 0.3s, border-color 0.3s;
    position: relative;
    z-index: 10000;
}
#large-text-banner.hidden { display: none; }
#large-text-banner.active {
    background: #fffbea;
    border-bottom-color: #c9a227;
    color: #7a6000;
    font-weight: 600;
}
.large-text-btn {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}
#large-text-banner:not(.active) .large-text-btn {
    background: var(--primary);
    color: white;
    border: 2px solid var(--primary);
}
#large-text-banner.active .large-text-btn {
    background: white;
    color: #7a6000;
    border: 2px solid #c9a227;
}

/* Dark mode variants */
body.dark-mode #large-text-banner {
    background: #1a2f4c;
    border-bottom-color: #285078;
    color: var(--text-medium);
}
body.dark-mode #large-text-banner.active {
    background: #2a2000;
    border-bottom-color: var(--accent);
    color: var(--accent);
}
body.dark-mode #large-text-banner:not(.active) .large-text-btn {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
}
body.dark-mode #large-text-banner.active .large-text-btn {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

@media (max-width: 480px) {
    #large-text-banner {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 16px;
    }
    #large-text-banner-label {
        flex: 1 1 100%;
        text-align: center;
    }
    .large-text-btn {
        width: 100%;
        text-align: center;
    }
}

/* Large text mode — scale base font size */
html:has(body.large-text) { font-size: 22px; }

/* Additional overrides for elements that need more than font scaling */
body.large-text .flow-option-btn {
    padding: 16px 20px;
    min-height: 64px;
    font-size: 1.1rem;
    line-height: 1.4;
}
body.large-text .flow-action-btn {
    font-size: 1.1rem;
    padding: 18px 24px;
}
body.large-text .btn-cal-service {
    padding: 20px;
}
body.large-text .cal-text h3 { font-size: 1.2rem; }
body.large-text .cal-text p  { font-size: 0.95rem; line-height: 1.6; }
body.large-text .contact-value { font-size: 1.2rem; }
body.large-text .contact-label { font-size: 0.9rem; }
body.large-text .hours-table td { font-size: 1.05rem; padding: 12px 0; }
body.large-text .step-content h3 { font-size: 1.2rem; }
body.large-text .step-content p  { font-size: 1rem; line-height: 1.7; }
body.large-text .qa-item {
    font-size: 0.72rem;
    gap: 5px;
    padding: 8px 10px;
}
body.large-text .qa-item i { font-size: 1.35rem; }