/**
 * GS Pharmacy Booking - Frontend Styles
 * Mobile-First, Ultra-Lightweight, Pharmacy-Focused UX
 * Brand Palette: Farmacia Villa Fiorelli (Institutional Blue #003e69 + Medical Teal #0e8a72)
 */

:root {
	/* Palette Istituzionale Farmacia Villa Fiorelli */
	--gspb-primary: #003e69;
	--gspb-primary-dark: #002845;
	--gspb-primary-light: #eaf3f8;
	--gspb-blue-mid: #025a94;
	
	/* Accenti Sanitari & Salute (Teal / Smeraldo) */
	--gspb-teal: #0e8a72;
	--gspb-teal-dark: #0a6b58;
	--gspb-teal-light: #e6f5f2;
	
	/* Gradienti Tasti & Badge (Mix Elegante Blu Istituzionale e riflesso Verde Salute) */
	--gspb-gradient-btn: linear-gradient(135deg, #003e69 0%, #025a94 65%, #0e8a72 100%);
	--gspb-gradient-btn-hover: linear-gradient(135deg, #002845 0%, #003e69 65%, #0a6b58 100%);
	--gspb-gradient-tab: linear-gradient(135deg, #003e69 0%, #025a94 100%);

	--gspb-secondary: #1e293b;
	--gspb-accent: #f59e0b;
	--gspb-whatsapp: #25d366;
	--gspb-whatsapp-dark: #128c7e;
	--gspb-bg: #f8fafc;
	--gspb-border: #e2e8f0;
	--gspb-text: #1e293b;
	--gspb-text-muted: #64748b;
	--gspb-radius: 10px;
	--gspb-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.gspb-wrapper {
	max-width: 900px;
	margin: 20px auto;
	padding: 24px;
	background: #ffffff;
	border-radius: var(--gspb-radius);
	box-shadow: var(--gspb-shadow);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--gspb-text);
	box-sizing: border-box;
}

.gspb-wrapper * {
	box-sizing: border-box;
}

/* Navigazione Progress 3-Step */
.gspb-steps-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 30px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--gspb-border);
}

.gspb-step-item {
	display: flex;
	align-items: center;
	gap: 8px;
	opacity: 0.45;
	transition: all 0.2s ease;
	cursor: pointer;
}

.gspb-step-item.active {
	opacity: 1;
}

.gspb-step-num {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #cbd5e1;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 700;
}

.gspb-step-item.active .gspb-step-num {
	background: var(--gspb-gradient-tab);
	box-shadow: 0 2px 8px rgba(0, 62, 105, 0.25);
}

.gspb-step-title {
	font-weight: 600;
	font-size: 14px;
	color: var(--gspb-text);
}

.gspb-step-line {
	width: 50px;
	height: 2px;
	background: #e2e8f0;
	margin: 0 12px;
}

/* Pannelli Step */
.gspb-step-panel {
	display: none;
	animation: gspbFadeIn 0.25s ease-out;
}

.gspb-step-panel.active {
	display: block;
}

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

.gspb-panel-header {
	margin-bottom: 22px;
}

.gspb-panel-header h3 {
	margin: 0 0 6px 0;
	font-size: 20px;
	font-weight: 700;
	color: var(--gspb-primary);
}

.gspb-panel-header p {
	margin: 0;
	font-size: 14px;
	color: var(--gspb-text-muted);
}

/* Filtri Categoria */
.gspb-cat-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 22px;
}

.gspb-cat-tab {
	padding: 8px 16px;
	background: var(--gspb-bg);
	border: 1.5px solid #cbd5e1;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	color: var(--gspb-text-muted);
	cursor: pointer;
	transition: all 0.2s;
}

.gspb-cat-tab:hover {
	border-color: var(--gspb-primary);
	color: var(--gspb-primary);
	background: #f0f7fc;
}

.gspb-cat-tab.active {
	background: var(--gspb-gradient-tab);
	border-color: var(--gspb-primary);
	color: #ffffff;
	box-shadow: 0 3px 10px rgba(0, 62, 105, 0.2);
}

/* Griglia Card Servizi */
.gspb-cards-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 16px;
}

.gspb-service-card {
	background: #ffffff;
	border: 1.5px solid var(--gspb-border);
	border-radius: var(--gspb-radius);
	padding: 18px;
	display: flex;
	flex-direction: column;
	cursor: pointer;
	transition: all 0.2s ease;
	position: relative;
	box-sizing: border-box;
	min-height: 250px;
	height: auto;
}

.gspb-service-card:hover {
	border-color: var(--gspb-primary);
	box-shadow: 0 6px 18px rgba(0, 62, 105, 0.12);
	transform: translateY(-2px);
}

.gspb-service-card.selected {
	border-color: var(--gspb-primary);
	background: var(--gspb-primary-light);
	box-shadow: 0 0 0 2px rgba(0, 62, 105, 0.15);
}

.gspb-card-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.gspb-badge-pill {
	display: inline-block;
	background: #eaf3f8;
	color: var(--gspb-primary);
	border: 1px solid #bae0f5;
	padding: 3px 8px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
}

.gspb-card-price {
	font-size: 18px;
	font-weight: 700;
	color: var(--gspb-primary);
	margin-left: auto;
}

.gspb-card-body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	margin-bottom: 14px;
}

.gspb-card-title {
	margin: 0 0 8px 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--gspb-text);
}

.gspb-card-desc {
	margin: 0 0 10px 0;
	font-size: 12px;
	color: var(--gspb-text-muted);
	line-height: 1.45;
	word-break: break-word;
}

.gspb-card-prep {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	background: #fffbeb;
	border: 1px solid #fef3c7;
	border-radius: 6px;
	padding: 8px 10px;
	font-size: 11px;
	color: #92400e;
	margin-top: auto;
	margin-bottom: 4px;
	line-height: 1.4;
	word-break: break-word;
}

.gspb-info-icon {
	display: inline-block;
	width: 14px;
	height: 14px;
	background: #f59e0b;
	color: #fff;
	border-radius: 50%;
	text-align: center;
	line-height: 14px;
	font-size: 10px;
	font-weight: bold;
	flex-shrink: 0;
}

.gspb-card-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-top: 1px solid #f1f5f9;
	padding-top: 12px;
	margin-top: auto;
	flex-shrink: 0;
	width: 100%;
}

.gspb-card-duration {
	font-size: 12px;
	color: var(--gspb-text-muted);
}

.gspb-btn-select {
	padding: 6px 14px;
	background: linear-gradient(135deg, #eaf3f8 0%, #dbeafe 100%);
	color: var(--gspb-primary);
	border: 1px solid #bae0f5;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s ease;
}

.gspb-service-card:hover .gspb-btn-select {
	background: var(--gspb-gradient-btn);
	color: #ffffff;
	border-color: var(--gspb-primary);
	box-shadow: 0 2px 8px rgba(0, 62, 105, 0.2);
}

/* Riepilogo Barra Superiore Step 2 */
.gspb-selected-summary {
	background: var(--gspb-primary-light);
	border: 1px solid #bae0f5;
	border-radius: 8px;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
}

.gspb-summary-label {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	color: var(--gspb-text-muted);
	margin-bottom: 2px;
}

.gspb-summary-price {
	font-size: 16px;
	font-weight: 700;
	color: var(--gspb-primary);
	margin-right: 12px;
}

.gspb-link-btn {
	background: none;
	border: none;
	color: var(--gspb-primary);
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
	text-decoration: underline;
	padding: 0;
}

.gspb-link-btn:hover {
	color: var(--gspb-blue-mid);
}

/* Box Date Disponibili Reali */
.gspb-avail-days-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
	gap: 12px;
	margin-bottom: 20px;
}

.gspb-avail-day-box {
	background: #ffffff;
	border: 2px solid var(--gspb-border);
	border-radius: 12px;
	padding: 14px 10px;
	text-align: center;
	cursor: pointer;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	position: relative;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.gspb-avail-day-box:hover {
	border-color: var(--gspb-primary);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 62, 105, 0.12);
}

.gspb-avail-day-box.active {
	border-color: var(--gspb-primary);
	background: #f4f8fb;
	box-shadow: 0 0 0 3px rgba(0, 62, 105, 0.15);
}

.gspb-avail-box-label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--gspb-primary);
	margin-bottom: 4px;
	letter-spacing: 0.5px;
}

.gspb-avail-box-date {
	font-size: 22px;
	font-weight: 800;
	color: var(--gspb-text);
	line-height: 1.2;
}

.gspb-avail-day-box.active .gspb-avail-box-date {
	color: var(--gspb-primary);
}

.gspb-avail-box-month {
	font-size: 12px;
	font-weight: 600;
	color: var(--gspb-text-muted);
	margin-bottom: 8px;
}

.gspb-avail-box-badge {
	font-size: 10px;
	font-weight: 600;
	padding: 3px 8px;
	background: #eaf3f8;
	color: var(--gspb-primary);
	border: 1px solid #bae0f5;
	border-radius: 10px;
	white-space: nowrap;
}

.gspb-avail-day-box.active .gspb-avail-box-badge {
	background: var(--gspb-gradient-btn);
	color: #ffffff;
	border: none;
}

@media (max-width: 600px) {
	.gspb-avail-days-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}
	.gspb-avail-day-box {
		padding: 12px 8px;
	}
	.gspb-avail-box-date {
		font-size: 20px;
	}
}

/* Slider Giorni Orizzontale Legacy Fallback */
.gspb-days-slider-wrapper {
	overflow-x: auto;
	margin: 0 -10px 24px -10px;
	padding: 6px 10px;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.gspb-days-slider {
	display: flex;
	gap: 10px;
	min-width: max-content;
}

.gspb-day-item {
	width: 72px;
	padding: 12px 6px;
	border: 1.5px solid var(--gspb-border);
	border-radius: 10px;
	background: #ffffff;
	text-align: center;
	cursor: pointer;
	transition: all 0.2s;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.gspb-day-item:hover {
	border-color: var(--gspb-primary);
}

.gspb-day-item.active {
	background: var(--gspb-primary);
	border-color: var(--gspb-primary);
	color: #ffffff;
}

.gspb-day-name {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	margin-bottom: 4px;
	opacity: 0.8;
}

.gspb-day-num {
	font-size: 18px;
	font-weight: 700;
}

.gspb-day-month {
	font-size: 11px;
	margin-top: 2px;
	opacity: 0.8;
}

.gspb-day-item.disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}

/* Slot Orari */
.gspb-slots-box {
	background: var(--gspb-bg);
	border: 1px solid var(--gspb-border);
	border-radius: var(--gspb-radius);
	padding: 20px;
	min-height: 180px;
}

.gspb-slots-group-title {
	margin: 0 0 10px 0;
	font-size: 14px;
	font-weight: 700;
	color: var(--gspb-text);
}

.gspb-slots-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
	gap: 8px;
}

.gspb-slot-pill {
	padding: 9px 4px;
	background: #ffffff;
	border: 1.5px solid #cbd5e1;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--gspb-text);
	text-align: center;
	cursor: pointer;
	transition: all 0.15s;
}

.gspb-slot-pill:hover {
	border-color: var(--gspb-primary);
	color: var(--gspb-primary);
	background: #f0f7fc;
}

.gspb-slot-pill.active {
	background: var(--gspb-gradient-tab);
	border-color: var(--gspb-primary);
	color: #ffffff;
	box-shadow: 0 3px 10px rgba(0, 62, 105, 0.22);
}

.gspb-loading-box, .gspb-empty-slots {
	text-align: center;
	padding: 35px 20px;
	color: var(--gspb-text-muted);
	font-size: 14px;
}

.gspb-spinner {
	width: 28px;
	height: 28px;
	border: 3px solid #e2e8f0;
	border-top-color: var(--gspb-primary);
	border-radius: 50%;
	animation: gspbSpin 0.7s linear infinite;
	margin: 0 auto 10px auto;
}

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

/* STEP 3: Form e Recap */
.gspb-recap-card {
	background: #f8fafc;
	border: 1px solid var(--gspb-border);
	border-radius: var(--gspb-radius);
	padding: 16px 20px;
	margin-bottom: 24px;
}

.gspb-recap-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 6px 0;
	font-size: 14px;
	border-bottom: 1px solid #f1f5f9;
}

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

.gspb-recap-prep {
	background: #fffbeb;
	border: 1px solid #fef3c7;
	border-radius: 6px;
	padding: 10px 14px;
	color: #92400e;
	font-size: 12px;
	margin-top: 10px;
}

.gspb-form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

@media (max-width: 600px) {
	.gspb-form-grid {
		grid-template-columns: 1fr;
	}
}

.gspb-form-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--gspb-text);
	margin-bottom: 6px;
}

.gspb-form-field input, .gspb-form-field textarea {
	width: 100%;
	padding: 10px 14px;
	border: 1.5px solid var(--gspb-border);
	border-radius: 6px;
	font-size: 14px;
	color: var(--gspb-text);
	background: #ffffff;
	transition: border-color 0.2s;
}

.gspb-form-field input:focus, .gspb-form-field textarea:focus {
	outline: none;
	border-color: var(--gspb-primary);
	box-shadow: 0 0 0 3px rgba(0, 62, 105, 0.1);
}

.gspb-form-field small {
	display: block;
	font-size: 11px;
	color: var(--gspb-text-muted);
	margin-top: 4px;
}

.gspb-payment-notice {
	background: #f0f7fc;
	border: 1px solid #bae0f5;
	border-radius: 6px;
	padding: 12px 16px;
	color: var(--gspb-primary);
	font-size: 13px;
	margin: 20px 0;
}

.gspb-gdpr-check {
	margin-bottom: 24px;
	font-size: 13px;
	color: var(--gspb-text-muted);
}

.gspb-form-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.gspb-btn-back {
	padding: 12px 20px;
	background: #f1f5f9;
	color: var(--gspb-text);
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.gspb-btn-back:hover {
	background: #e2e8f0;
	color: #0f172a;
}

/* Pulsante Primario Conferma Prenotazione (Mix Blu Istituzionale e riflesso Teal Sanitario) */
.gspb-btn-confirm {
	flex-grow: 1;
	padding: 14px 24px;
	background: var(--gspb-gradient-btn);
	color: #ffffff;
	border: none;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.25s ease;
	box-shadow: 0 4px 14px rgba(0, 62, 105, 0.22);
	letter-spacing: 0.3px;
}

.gspb-btn-confirm:hover {
	background: var(--gspb-gradient-btn-hover);
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(0, 62, 105, 0.3);
}

.gspb-form-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 13px;
	margin-top: 14px;
}

/* Schermata di Successo */
.gspb-success-box {
	text-align: center;
	padding: 20px 10px;
}

.gspb-success-icon {
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: #eaf3f8;
	color: var(--gspb-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	font-weight: bold;
	margin: 0 auto 16px auto;
	box-shadow: 0 0 0 6px rgba(0, 62, 105, 0.08);
}

.gspb-success-box h2 {
	margin: 0 0 6px 0;
	font-size: 24px;
	color: var(--gspb-primary);
}

.gspb-success-box p {
	color: var(--gspb-text-muted);
	margin: 0 0 24px 0;
}

.gspb-success-ticket {
	max-width: 440px;
	margin: 0 auto 24px auto;
	background: #f8fafc;
	border: 1px solid var(--gspb-border);
	border-radius: var(--gspb-radius);
	padding: 20px;
	text-align: left;
}

.gspb-ticket-row {
	display: flex;
	justify-content: space-between;
	padding: 8px 0;
	border-bottom: 1px solid #f1f5f9;
	font-size: 14px;
}

.gspb-ticket-location {
	margin-top: 14px;
	font-size: 12px;
	color: var(--gspb-text-muted);
	text-align: center;
}

.gspb-wa-action-box {
	max-width: 440px;
	margin: 0 auto;
}

.gspb-wa-large-btn {
	display: block;
	padding: 14px 20px;
	background: var(--gspb-whatsapp);
	color: #ffffff;
	text-decoration: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 700;
	transition: background 0.2s;
	box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

.gspb-wa-large-btn:hover {
	background: var(--gspb-whatsapp-dark);
	color: #ffffff;
}

.gspb-wa-action-box small {
	display: block;
	color: var(--gspb-text-muted);
	margin-top: 6px;
	font-size: 11px;
}
