/* ============================================
   GRUPPO ORSO - Sistema Prenotazioni
   Stile elegante, minimal, mobile-first
   ============================================ */

/* CSS Variables */
:root {
    /* Colors - Base */
    --color-bg: #FAFAFA;
    --color-surface: #FFFFFF;
    --color-text: #1A1A1A;
    --color-text-secondary: #666666;
    --color-text-muted: #999999;
    --color-border: #E5E5E5;
    --color-border-light: #F0F0F0;
    
    /* Accent colors per locale */
    --color-accent: #2C3E50;
    --color-accent-light: #3D5166;
    --color-accent-dark: #1A252F;
    
    /* Colori specifici locali */
    --color-blanco: #0077B6;
    --color-blanco-dark: #005a8a;
    --color-calapso: #8B5A2B;
    --color-calapso-dark: #6d4722;
    --color-duomo: #6B8E6B;
    --color-duomo-dark: #567056;
    
    /* Semantic colors */
    --color-success: #2E7D32;
    --color-success-bg: #E8F5E9;
    --color-error: #C62828;
    --color-error-bg: #FFEBEE;
    --color-warning: #F57C00;
    --color-warning-bg: #FFF3E0;
    
    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.16);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    
    /* Container */
    --container-max: 480px;
}

/* Theme variations per locale */
[data-theme="blanco"] {
    --color-accent: #0077B6;
    --color-accent-light: #0096C7;
    --color-accent-dark: #005F8A;
}

[data-theme="calapso"] {
    --color-accent: #8B5A2B;
    --color-accent-light: #A0693A;
    --color-accent-dark: #6B4423;
}

[data-theme="duomo"] {
    --color-accent: #6B8E6B;
    --color-accent-light: #7FA37F;
    --color-accent-dark: #4A6B4A;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    min-height: 100dvh;
}

/* ============================================
   Loading Screen
   ============================================ */
.loading-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    z-index: 9999;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}

.loader-ring {
    width: 48px;
    height: 48px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loader-text {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    letter-spacing: 0.05em;
}

/* ============================================
   Sections
   ============================================ */
.section {
    min-height: 100vh;
    min-height: 100dvh;
    opacity: 1;
    transition: opacity var(--transition-base);
}

.section.hidden {
    display: none;
    opacity: 0;
}

/* ============================================
   Home Section
   ============================================ */
.home-header {
    padding: var(--space-3xl) var(--space-lg) var(--space-xl);
    text-align: center;
    background: var(--color-surface);
}

.brand-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-xs);
}

.brand-subtitle {
    font-size: 1rem;
    color: var(--color-text-secondary);
    font-weight: 300;
}

.venues-container {
    padding: 0 var(--space-lg) var(--space-2xl);
    max-width: 700px;
    margin: 0 auto;
}

.venues-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: var(--space-xl);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.venues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

/* ============================================
   VENUE CARDS - SFONDO BIANCO CON LINGUETTA COLORATA
   ============================================ */
.venue-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space-xl) var(--space-2xl);
    min-height: 280px;
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    color: var(--color-text);
    text-align: center;
    position: relative;
    overflow: hidden;
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
}

/* Linguetta colorata in alto */
.venue-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    transition: height var(--transition-fast);
}

.venue-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.venue-card:hover::before {
    height: 12px;
}

.venue-card:active {
    transform: translateY(-2px);
}

/* Colori linguetta per locale */
.venue-card[data-venue="blanco"]::before {
    background: linear-gradient(90deg, #0077B6 0%, #0096C7 100%);
}

.venue-card[data-venue="calapso"]::before {
    background: linear-gradient(90deg, #8B5A2B 0%, #A0693A 100%);
}

.venue-card[data-venue="duomo"]::before {
    background: linear-gradient(90deg, #6B8E6B 0%, #7FA37F 100%);
}

/* Ombre hover colorate */
.venue-card[data-venue="blanco"]:hover {
    box-shadow: 0 12px 32px rgba(0, 119, 182, 0.2);
}

.venue-card[data-venue="calapso"]:hover {
    box-shadow: 0 12px 32px rgba(139, 90, 43, 0.2);
}

.venue-card[data-venue="duomo"]:hover {
    box-shadow: 0 12px 32px rgba(107, 142, 107, 0.2);
}

/* Logo del locale */
.venue-card-logo {
    width: 200px;
    height: 130px;
    margin-bottom: var(--space-md);
    margin-top: var(--space-sm);
    object-fit: contain;
}

/* Fallback icona se non c'è logo */
.venue-card-icon {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: var(--space-lg);
    background: var(--color-bg);
}

/* Nome locale */
.venue-card-name {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--color-text);
}

/* Indirizzo */
.venue-card-address {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    font-weight: 400;
}

/* Nascondo elementi non necessari */
.venue-card-accent,
.venue-card-arrow,
.venue-card-body,
.venue-card-content {
    display: contents;
}

.home-footer {
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ============================================
   Booking Section
   ============================================ */
.booking-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
    z-index: 100;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: var(--color-text);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

.back-btn:hover {
    background: var(--color-border-light);
}

.venue-info {
    flex: 1;
    min-width: 0;
}

.venue-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.venue-address {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.booking-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-lg);
}

/* Progress Bar */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-2xl);
    padding: 0 var(--space-md);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.step-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--color-border-light);
    color: var(--color-text-muted);
    transition: all var(--transition-base);
}

.progress-step.active .step-number,
.progress-step.completed .step-number {
    background: var(--color-accent);
    color: white;
}

.step-label {
    font-size: 0.625rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color var(--transition-base);
}

.progress-step.active .step-label {
    color: var(--color-accent);
    font-weight: 500;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: var(--color-border-light);
    max-width: 40px;
}

/* Booking Steps */
.booking-step {
    display: none;
    animation: fadeIn var(--transition-base);
}

.booking-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-content {
    margin-bottom: var(--space-xl);
}

.step-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    text-align: center;
}

/* Form Elements */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.form-label .optional {
    font-weight: 400;
    color: var(--color-text-muted);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: var(--space-md);
    font-family: var(--font-body);
    font-size: 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* People Selector */
.people-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    padding: var(--space-md);
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.people-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 500;
    border: none;
    background: var(--color-border-light);
    color: var(--color-text);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.people-btn:hover:not(:disabled) {
    background: var(--color-accent);
    color: white;
}

.people-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.people-count {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

/* Calendar */
.calendar {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--color-bg);
}

.calendar-nav {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--color-text);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

.calendar-nav:hover {
    background: var(--color-border-light);
}

.calendar-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.calendar-month {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    text-transform: capitalize;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border-light);
}

.calendar-weekdays span {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: var(--space-sm);
    gap: var(--space-xs);
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border: none;
    background: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.calendar-day:hover:not(:disabled):not(.selected) {
    background: var(--color-border-light);
}

.calendar-day.today {
    font-weight: 600;
    color: var(--color-accent);
}

.calendar-day.selected {
    background: var(--color-accent);
    color: white;
    font-weight: 500;
}

.calendar-day:disabled {
    color: var(--color-text-muted);
    opacity: 0.4;
    cursor: not-allowed;
}

.calendar-day.other-month {
    color: var(--color-text-muted);
    opacity: 0.3;
}

/* Time Slots */
.time-slots-container {
    margin-top: var(--space-lg);
}

.selected-info {
    text-align: center;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
}

.time-slots-section {
    margin-bottom: var(--space-xl);
}

.time-slots-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.time-slot {
    padding: var(--space-md);
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: center;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.time-slot:hover:not(:disabled):not(.selected) {
    border-color: var(--color-accent);
    background: rgba(44, 62, 80, 0.05);
}

.time-slot.selected {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}

.time-slot:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Customer Form */
.customer-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Booking Summary */
.booking-summary {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-label {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.summary-value {
    font-weight: 500;
    text-align: right;
}

.summary-row.highlight {
    background: var(--color-bg);
}

.summary-row.highlight .summary-value {
    font-family: var(--font-display);
    font-size: 1.125rem;
}

/* Privacy Checkbox */
.privacy-group {
    margin-top: var(--space-md);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    cursor: pointer;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    position: relative;
}

.checkbox-label input:checked ~ .checkmark {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.checkbox-label input:checked ~ .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.link {
    color: var(--color-accent);
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

/* Step Actions */
.step-actions {
    display: flex;
    gap: var(--space-md);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    flex: 1;
    background: var(--color-accent);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-accent-dark);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--color-border-light);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: var(--color-border);
}

.btn-submit {
    min-height: 52px;
}

.btn-loader {
    display: flex;
    align-items: center;
}

.btn-loader.hidden {
    display: none;
}

.spinner {
    animation: spin 1s linear infinite;
}

/* ============================================
   Success Section
   ============================================ */
.success-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    text-align: center;
}

.success-icon {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-success-bg);
    border-radius: var(--radius-full);
    color: var(--color-success);
    margin-bottom: var(--space-xl);
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.success-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.success-message {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
}

.success-details {
    width: 100%;
    max-width: 320px;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    text-align: left;
}

.success-detail-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.success-detail-row:last-child {
    border-bottom: none;
}

.success-detail-label {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.success-detail-value {
    font-weight: 500;
}

.success-note {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
}

/* ============================================
   Cancel Section
   ============================================ */
.cancel-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

#cancel-content {
    max-width: 400px;
    text-align: center;
}

.cancel-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-xl);
    border-radius: var(--radius-full);
}

.cancel-icon.warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.cancel-icon.success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.cancel-icon.error {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.cancel-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.cancel-message {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
}

.cancel-details {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    text-align: left;
}

.cancel-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.btn-danger {
    background: var(--color-error);
    color: white;
}

.btn-danger:hover {
    background: #B71C1C;
}

/* ============================================
   Utilities
   ============================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--color-text-muted);
}

/* ============================================
   Media Queries
   ============================================ */
@media (max-width: 640px) {
    .venues-grid {
        grid-template-columns: 1fr;
    }
    
    .venue-card {
        min-height: 160px;
    }
}

@media (min-width: 768px) {
    :root {
        --container-max: 520px;
    }
    
    .brand-title {
        font-size: 3rem;
    }
    
    .step-title {
        font-size: 1.75rem;
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .booking-header,
    .progress-bar,
    .step-actions {
        display: none;
    }
}
