/* ═══════════════════════════════════════════════════════════
   web_booking.css – Stile prenotazione web
   ═══════════════════════════════════════════════════════════ */

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

:root {
    --bg: #1a1a2e;
    --accent: #e94560;
    --accent-hover: #ff6b81;
    --card-bg: rgba(255, 255, 255, 0.06);
    --card-bg-hover: rgba(255, 255, 255, 0.10);
    --card-border: rgba(255, 255, 255, 0.10);
    --text: #f0f0f0;
    --text-muted: #a0a0b0;
    --text-dark: #333;
    --success: #25D366;
    --danger: #e94560;
    --warning: #f59e0b;
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.25s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.03) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, var(--accent), transparent 50%);
    opacity: 0.12;
    z-index: 0;
    pointer-events: none;
}

/* ── Container ───────────────────────────────────────────── */
.booking-container {
    position: relative;
    z-index: 1;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px 28px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    animation: fadeUp 0.5s ease-out;
}

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

/* ── Header ──────────────────────────────────────────────── */
.booking-header {
    text-align: center;
    margin-bottom: 24px;
}

.header-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.06); }
}

.shop-name {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin-bottom: 6px;
}

.shop-address {
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* ── Progress Bar ────────────────────────────────────────── */
.progress-bar {
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: 4px;
    width: 0%;
    transition: width 0.4s ease;
}

.step-indicator {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ── Steps ───────────────────────────────────────────────── */
.step {
    display: none;
    animation: stepIn 0.35s ease-out;
}

.step.active { display: block; }

@keyframes stepIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.step-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
}

.step-desc {
    font-size: 15px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    font-size: 15px;
    padding: 12px 24px;
    width: 100%;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    box-shadow: 0 4px 20px rgba(233, 69, 96, 0.3);
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 8px 30px rgba(233, 69, 96, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--text);
    border: 1px solid var(--card-border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.15); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    padding: 8px 16px;
}
.btn-ghost:hover { color: var(--text); }

.btn-lg { padding: 16px 28px; font-size: 17px; }
.btn-sm { padding: 8px 16px; font-size: 13px; width: auto; }

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ── Service Cards ───────────────────────────────────────── */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.service-card:hover {
    background: var(--card-bg-hover);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.service-card.selected {
    border-color: var(--accent);
    background: rgba(233, 69, 96, 0.12);
}

.service-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.service-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}

.service-check {
    width: 24px; height: 24px;
    border: 2px solid var(--card-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all var(--transition);
    flex-shrink: 0;
}

.service-card.selected .service-check {
    background: var(--accent);
    border-color: var(--accent);
}

.selected-services {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-sm);
    border: 1px solid var(--card-border);
}

.selected-services h3 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.selected-services ul {
    list-style: none;
    padding: 0;
}

.selected-services li {
    font-size: 14px;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.selected-services li::before {
    content: '✓';
    color: var(--accent);
    font-weight: 700;
}

.total-duration {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ── Operator Cards ──────────────────────────────────────── */
.operator-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.operator-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    font-size: 15px;
    font-weight: 600;
}

.operator-card:hover {
    background: var(--card-bg-hover);
    border-color: var(--accent);
}

/* ── Period / Day / TimeRange buttons ────────────────────── */
.period-buttons,
.timerange-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.period-btn,
.timerange-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.period-btn:hover,
.timerange-btn:hover {
    background: var(--card-bg-hover);
    border-color: var(--accent);
    transform: translateY(-1px);
}

/* ── Days Grid ───────────────────────────────────────────── */
.days-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.day-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 14px 10px;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.day-card:hover {
    background: var(--card-bg-hover);
    border-color: var(--accent);
}

.day-card .day-name {
    font-size: 13px;
    color: var(--text-muted);
    display: block;
}

.day-card .day-date {
    font-size: 16px;
    font-weight: 700;
    margin-top: 2px;
}

/* ── Slots Grid ──────────────────────────────────────────── */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.slot-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.slot-card:hover {
    background: var(--card-bg-hover);
    border-color: var(--accent);
}

.slot-card .slot-time {
    font-size: 16px;
    font-weight: 700;
}

.slot-card .slot-operator {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Summary Card ────────────────────────────────────────── */
.summary-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 14px;
}

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

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

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

/* ── Form ────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    transition: border-color var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
}

.form-input::placeholder {
    color: rgba(255,255,255,0.25);
}

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

/* ── Done Card ───────────────────────────────────────────── */
.done-card {
    text-align: center;
}

.done-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
    animation: popIn 0.5s ease-out;
}

@keyframes popIn {
    0%   { transform: scale(0); opacity: 0; }
    70%  { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

#doneDetails {
    text-align: left;
    margin: 20px 0;
}

/* ── Info Card ───────────────────────────────────────────── */
.info-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 20px;
    line-height: 1.7;
    font-size: 14px;
    color: var(--text-muted);
    white-space: pre-wrap;
}

/* ── Manage Result ───────────────────────────────────────── */
#manageResult {
    margin-top: 20px;
}

.manage-booking-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 16px;
}

/* ── Loading ─────────────────────────────────────────────── */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 24px;
    gap: 12px;
}

.spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.loading-overlay p {
    font-size: 14px;
    color: var(--text-muted);
}

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

/* ── Shop Cards (lista negozi) ───────────────────────────── */
.shops-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.shop-card {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px 20px;
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    text-align: center;
}

.shop-card:hover {
    background: var(--card-bg-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.shop-card-icon { font-size: 36px; display: block; margin-bottom: 10px; }
.shop-card-name { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.shop-card-addr { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.shop-card-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }

.shop-card-cta {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    transition: color var(--transition);
}

.shop-card:hover .shop-card-cta { color: var(--accent-hover); }

/* ── Footer ──────────────────────────────────────────────── */
.booking-footer {
    position: relative;
    z-index: 1;
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.5;
    text-align: center;
}

.booking-footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.booking-footer a:hover { text-decoration: underline; }

/* ── Toast / Notifications ───────────────────────────────── */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(30, 30, 50, 0.95);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    color: var(--text);
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 200;
    transition: transform 0.35s ease;
    max-width: 90%;
    text-align: center;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--danger); }
.toast.success { border-color: var(--success); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
    body { padding: 12px 8px; }
    .booking-container { padding: 28px 18px; border-radius: 20px; }
    .shop-name { font-size: 22px; }
    .step-title { font-size: 18px; }
    .slots-grid { grid-template-columns: repeat(2, 1fr); }
    .days-grid { grid-template-columns: repeat(2, 1fr); }
    .btn-lg { padding: 14px 20px; font-size: 15px; }
}
