/* ============================================================
   pages/prenota/modulo_prenotazione.css
   Stili del modulo di prenotazione lato utente.
   Usa le variabili CSS del sito (--orange, --text, --subtext,
   --ok, --error, --white, --white-text).
   ============================================================ */

/* ---------------------------------------------------------------
   Wrapper esterno — si adatta al contenitore in cui viene incluso
--------------------------------------------------------------- */
.mp-wrap {
	width: 100%;
	font-family: inherit;
	color: var(--text);
	line-height: 1.5;
}

/* ---------------------------------------------------------------
   Layout a due colonne: calendario | form dati
--------------------------------------------------------------- */
.mp-layout {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
	align-items: start;
}

@media (max-width: 860px) {
	.mp-layout {
		grid-template-columns: 1fr;
	}
}

/* ---------------------------------------------------------------
   Card generica usata sia per il calendario che per il form
--------------------------------------------------------------- */
.mp-card {
	background: var(--white);
	border-radius: 14px;
	box-shadow: 0 4px 28px rgba(0, 0, 0, 0.07);
	overflow: hidden;
}

.mp-card-header {
	padding: 1.2rem 1.5rem 1rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mp-card-title {
	font-size: 1rem;
	font-weight: 700;
	color: var(--text);
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.15rem;
}

.mp-card-title i {
	color: var(--orange);
}

.mp-card-subtitle {
	font-size: 0.78rem;
	color: var(--subtext);
}

.mp-card-body {
	padding: 1.3rem 1.5rem;
}

/* ---------------------------------------------------------------
   Navigazione mese calendario
--------------------------------------------------------------- */
.mp-cal-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1rem;
}

.mp-cal-nav-btn {
	width: 34px;
	height: 34px;
	border: 1.5px solid rgba(0, 0, 0, 0.10);
	border-radius: 8px;
	background: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--subtext);
	font-size: 0.9rem;
	transition: all 0.15s;
}

.mp-cal-nav-btn:hover {
	border-color: var(--orange);
	color: var(--orange);
	background: rgba(232, 115, 42, 0.06);
}

.mp-cal-month-label {
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--text);
	text-align: center;
	flex: 1;
}

/* ---------------------------------------------------------------
   Griglia calendario
--------------------------------------------------------------- */
.mp-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 3px;
}

.mp-cal-dow {
	text-align: center;
	font-size: 0.65rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--subtext);
	padding: 4px 0 6px;
}

.mp-cal-day {
	position: relative;
	aspect-ratio: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	font-size: 0.83rem;
	font-weight: 400;
	cursor: pointer;
	border: 1.5px solid transparent;
	background: none;
	color: var(--text);
	transition: all 0.14s;
	user-select: none;
	line-height: 1;
}

/* Hover su giorni liberi */
.mp-cal-day:hover:not(.mp-day-empty):not(.mp-day-past):not(.mp-day-booked):not(.mp-day-closed) {
	background: rgba(232, 115, 42, 0.10);
	border-color: var(--orange);
	color: var(--orange);
}

/* Celle vuote prima del 1° del mese */
.mp-day-empty {
	cursor: default;
	pointer-events: none;
}

/* Giorni passati */
.mp-day-past {
	color: #ccc;
	cursor: not-allowed;
}

/* Oggi */
.mp-day-today {
	border-color: var(--orange);
	color: var(--orange);
	font-weight: 700;
}

/* Prenotato o chiuso — rosso barrato */
.mp-day-booked,
.mp-day-closed {
	background: rgba(217, 48, 37, 0.07);
	color: #ccc;
	cursor: not-allowed;
	text-decoration: line-through;
}

/* Check-in selezionato */
.mp-day-checkin {
	background: var(--orange) !important;
	color: var(--white-text) !important;
	font-weight: 700;
	border-color: var(--orange) !important;
	border-radius: 8px 0 0 8px;
}

/* Check-out selezionato */
.mp-day-checkout {
	background: var(--orange) !important;
	color: var(--white-text) !important;
	font-weight: 700;
	border-color: var(--orange) !important;
	border-radius: 0 8px 8px 0;
}

/* Se check-in e check-out sono lo stesso giorno (non dovrebbe accadere, ma per sicurezza) */
.mp-day-checkin.mp-day-checkout {
	border-radius: 8px;
}

/* Giorni nel range selezionato (tra check-in e check-out) */
.mp-day-in-range {
	background: rgba(232, 115, 42, 0.13);
	color: var(--text);
	border-radius: 0;
	border-color: transparent;
}

/* Piccolo punto sotto la data per i giorni con prezzo assegnato */
.mp-day-price-dot {
	position: absolute;
	bottom: 3px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 0.5rem;
	color: var(--orange);
	line-height: 1;
}

/* ---------------------------------------------------------------
   Legenda sotto il calendario
--------------------------------------------------------------- */
.mp-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.8rem 1.4rem;
	margin-top: 1rem;
	padding-top: 0.9rem;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	font-size: 0.72rem;
	color: var(--subtext);
}

.mp-legend-item {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.mp-legend-dot {
	width: 11px;
	height: 11px;
	border-radius: 3px;
	flex-shrink: 0;
}

/* ---------------------------------------------------------------
   Riepilogo date selezionate (sopra il form)
--------------------------------------------------------------- */
.mp-dates-summary {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 0.5rem;
	background: rgba(232, 115, 42, 0.07);
	border: 1.5px solid rgba(232, 115, 42, 0.2);
	border-radius: 10px;
	padding: 0.85rem 1rem;
	margin-bottom: 1.2rem;
}

.mp-dates-summary.mp-dates-empty {
	background: rgba(0, 0, 0, 0.03);
	border-color: rgba(0, 0, 0, 0.08);
}

.mp-date-pill {
	text-align: center;
}

.mp-date-pill-label {
	font-size: 0.63rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--subtext);
	margin-bottom: 0.2rem;
}

.mp-date-pill-value {
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--text);
}

.mp-date-pill-value.mp-placeholder {
	color: #ccc;
	font-weight: 400;
}

.mp-dates-arrow {
	text-align: center;
	color: var(--orange);
	font-size: 1rem;
}

.mp-nights-badge {
	display: inline-block;
	background: var(--orange);
	color: var(--white-text);
	font-size: 0.7rem;
	font-weight: 700;
	padding: 0.15rem 0.55rem;
	border-radius: 20px;
	margin-top: 0.2rem;
}

/* ---------------------------------------------------------------
   Form dati ospite
--------------------------------------------------------------- */
.mp-form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.mp-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.8rem;
}

@media (max-width: 480px) {
	.mp-form-row {
		grid-template-columns: 1fr;
	}
}

.mp-form-group {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}

.mp-label {
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--subtext);
	text-transform: uppercase;
	letter-spacing: 0.07em;
}

.mp-label .mp-required {
	color: var(--orange);
	margin-left: 2px;
}

.mp-input,
.mp-select,
.mp-textarea {
	width: 100%;
	box-sizing: border-box;   /* fondamentale: padding e border inclusi nella width */
	padding: 0.6rem 0.85rem;
	border: 1.5px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	font-size: 0.88rem;
	font-family: inherit;
	color: var(--text);
	background: var(--white);
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
	appearance: none;
	-webkit-appearance: none;
}

.mp-input:focus,
.mp-select:focus,
.mp-textarea:focus {
	border-color: var(--orange);
	box-shadow: 0 0 0 3px rgba(232, 115, 42, 0.12);
}

.mp-input::placeholder,
.mp-textarea::placeholder {
	color: #bbb;
}

.mp-select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.85rem center;
	padding-right: 2.2rem;
	cursor: pointer;
}

.mp-textarea {
	resize: vertical;
	min-height: 72px;
}

/* ---------------------------------------------------------------
   Riepilogo prezzo
--------------------------------------------------------------- */
.mp-price-summary {
	background: rgba(0, 0, 0, 0.025);
	border-radius: 10px;
	padding: 1rem 1.1rem;
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
}

.mp-price-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 0.84rem;
	color: var(--subtext);
}

.mp-price-row.mp-price-total {
	font-size: 1rem;
	font-weight: 700;
	color: var(--text);
	padding-top: 0.55rem;
	margin-top: 0.2rem;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.mp-price-row.mp-price-total .mp-price-value {
	color: var(--orange);
}

/* ---------------------------------------------------------------
   Pulsante submit
--------------------------------------------------------------- */
.mp-submit-btn {
	width: 100%;
	padding: 0.85rem 1.5rem;
	background: var(--orange);
	color: var(--white-text);
	border: none;
	border-radius: 10px;
	font-size: 0.92rem;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	transition: all 0.17s;
	letter-spacing: 0.01em;
}

.mp-submit-btn:hover:not(:disabled) {
	filter: brightness(0.9);
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(232, 115, 42, 0.28);
}

.mp-submit-btn:active:not(:disabled) {
	transform: translateY(0);
	box-shadow: none;
}

.mp-submit-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.mp-submit-btn i {
	font-size: 1rem;
}

/* ---------------------------------------------------------------
   Alert / Messaggi
--------------------------------------------------------------- */
.mp-alert {
	display: flex;
	align-items: center;      /* icona allineata verticalmente al centro del testo */
	gap: 0.6rem;
	padding: 0.8rem 1rem;
	border-radius: 8px;
	font-size: 0.82rem;
	border-left: 3px solid;
}

.mp-alert i {
	flex-shrink: 0;
	font-size: 0.95rem;       /* dimensione icona uniforme */
}

.mp-alert-info {
	background: rgba(29, 111, 164, 0.08);
	border-color: #1D6FA4;
	color: #0f4f7a;
}

.mp-alert-warn {
	background: rgba(217, 119, 6, 0.08);
	border-color: #D97706;
	color: #92590a;
}

.mp-alert-error {
	background: rgba(217, 48, 37, 0.08);
	border-color: var(--error);
	color: var(--error);
}

.mp-alert-ok {
	background: rgba(46, 158, 91, 0.08);
	border-color: var(--ok);
	color: #1a6638;
}

/* ---------------------------------------------------------------
   Stato di invio riuscito (sostituisce il form)
--------------------------------------------------------------- */
.mp-success {
	text-align: center;
	padding: 2.5rem 1.5rem;
}

.mp-success-icon {
	font-size: 3rem;
	color: var(--ok);
	margin-bottom: 1rem;
}

.mp-success-title {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--text);
	margin-bottom: 0.4rem;
}

.mp-success-desc {
	font-size: 0.88rem;
	color: var(--subtext);
	line-height: 1.6;
}

/* ---------------------------------------------------------------
   Spinner caricamento
--------------------------------------------------------------- */
.mp-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: var(--white-text);
	border-radius: 50%;
	animation: mp-spin 0.7s linear infinite;
	flex-shrink: 0;
}

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

/* ---------------------------------------------------------------
   Privacy / note legali
--------------------------------------------------------------- */
.mp-privacy-note {
	font-size: 0.72rem;
	color: var(--subtext);
	text-align: center;
	line-height: 1.5;
}

.mp-privacy-note a {
	color: var(--orange);
	text-decoration: underline;
}

/* ---------------------------------------------------------------
   Min nights warning
--------------------------------------------------------------- */
.mp-min-nights-warn {
	font-size: 0.75rem;
	color: var(--error);
	display: none;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.3rem;
}

.mp-min-nights-warn.visible {
	display: flex;
}