/* ==========================================================================
   Autonautica Marconi - Gestione Appuntamenti (Google Calendar Weekly Style)
   ========================================================================== */

.am-pren-app {
	--am-primary: #1a73e8;
	--am-primary-dark: #1557b0;
	--am-primary-light: #e8f0fe;
	--am-avail-bg: #e6f4ea;
	--am-avail-border: #1e8e3e;
	--am-avail-text: #137333;
	--am-booked-bg: #f1f3f4;
	--am-booked-border: #dadce0;
	--am-booked-text: #70757a;
	--am-danger: #d93025;
	--am-danger-bg: #fce8e6;
	--am-warning: #e37400;
	--am-warning-bg: #fef7e0;
	--am-border: #dadce0;
	--am-grid-line: #e8eaed;
	--am-text: #202124;
	--am-muted: #5f6368;
	--am-bg: #ffffff;
	--am-surface: #f8f9fa;

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--am-text);
	background: var(--am-bg);
	border: 1px solid var(--am-border);
	border-radius: 12px;
	box-shadow: 0 2px 10px rgba(60, 64, 67, 0.08);
	overflow: hidden;
	margin: 24px 0;
	line-height: 1.45;
	box-sizing: border-box;
}

.am-pren-app *,
.am-pren-app *::before,
.am-pren-app *::after {
	box-sizing: border-box;
}

/* Loading */
.am-pren-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 48px 24px;
	color: var(--am-muted);
	font-size: 15px;
}

.am-pren-spinner {
	width: 22px;
	height: 22px;
	border: 3px solid var(--am-grid-line);
	border-top-color: var(--am-primary);
	border-radius: 50%;
	animation: am-spin 0.8s linear infinite;
}

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

/* Top bar */
.am-topbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 16px 22px;
	background: #ffffff;
	border-bottom: 1px solid var(--am-border);
}

.am-topbar-service {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.am-topbar-title-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.am-service-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--am-primary);
	flex-shrink: 0;
}

.am-topbar-title {
	margin: 0;
	font-size: 20px;
	font-weight: 600;
	color: var(--am-text);
}

.am-duration-pill {
	display: inline-flex;
	align-items: center;
	font-size: 12px;
	font-weight: 600;
	color: var(--am-primary);
	background: var(--am-primary-light);
	padding: 3px 10px;
	border-radius: 999px;
}

.am-topbar-desc {
	margin: 0;
	font-size: 13px;
	color: var(--am-muted);
}

.am-topbar-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.am-auth-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	background: var(--am-avail-bg);
	color: var(--am-avail-text);
	padding: 5px 11px;
	border-radius: 999px;
	font-weight: 500;
}

.am-auth-pill button {
	background: none;
	border: none;
	color: var(--am-avail-text);
	text-decoration: underline;
	cursor: pointer;
	padding: 0;
	font-size: 12px;
	font-weight: 600;
}

/* Buttons */
.am-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: 8px;
	border: 1px solid var(--am-border);
	background: #ffffff;
	color: var(--am-text);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
	text-decoration: none;
	line-height: 1.3;
}

.am-btn:hover:not(:disabled) {
	background: var(--am-surface);
	border-color: #bdc1c6;
}

.am-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.am-btn-primary {
	background: var(--am-primary);
	border-color: var(--am-primary);
	color: #ffffff;
}

.am-btn-primary:hover:not(:disabled) {
	background: var(--am-primary-dark);
	border-color: var(--am-primary-dark);
	color: #ffffff;
}

.am-btn-danger {
	background: #ffffff;
	border-color: #f6aea9;
	color: var(--am-danger);
}

.am-btn-danger:hover:not(:disabled) {
	background: var(--am-danger-bg);
	border-color: var(--am-danger);
}

.am-btn-danger-solid {
	background: var(--am-danger);
	border-color: var(--am-danger);
	color: #ffffff;
}

.am-btn-danger-solid:hover:not(:disabled) {
	background: #b31412;
	border-color: #b31412;
}

.am-btn-tab.is-active {
	background: var(--am-primary-light);
	border-color: var(--am-primary);
	color: var(--am-primary);
	font-weight: 600;
}

.am-btn-icon {
	width: 36px;
	height: 36px;
	padding: 0;
	border-radius: 50%;
	font-size: 18px;
}

/* Alerts & Banners */
.am-pren-notice,
.am-alert {
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 14px;
	margin: 14px 20px;
}

.am-alert-error,
.am-pren-notice-error {
	background: var(--am-danger-bg);
	color: #a50e0e;
	border: 1px solid #f6aea9;
}

.am-alert-success {
	background: var(--am-avail-bg);
	color: var(--am-avail-text);
	border: 1px solid #a8dab5;
}

.am-alert-info {
	background: var(--am-primary-light);
	color: #174ea6;
	border: 1px solid #aecbfa;
}

.am-alert-warning {
	background: var(--am-warning-bg);
	color: #b06000;
	border: 1px solid #fdd663;
}

.am-edit-banner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 12px 20px 0;
	padding: 12px 16px;
	background: var(--am-warning-bg);
	border: 1px solid #fdd663;
	border-radius: 8px;
	font-size: 14px;
	color: #7c4a03;
}

/* ==========================================================================
   GOOGLE CALENDAR WEEKLY TOOLBAR & GRID
   ========================================================================== */

.am-gcal-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 20px;
	background: #ffffff;
	border-bottom: 1px solid var(--am-border);
}

.am-gcal-nav {
	display: flex;
	align-items: center;
	gap: 8px;
}

.am-gcal-range {
	font-size: 18px;
	font-weight: 500;
	color: var(--am-text);
	margin-left: 8px;
}

.am-gcal-legend {
	display: flex;
	align-items: center;
	gap: 14px;
	font-size: 12px;
	color: var(--am-muted);
	flex-wrap: wrap;
}

.am-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.am-legend-swatch {
	width: 12px;
	height: 12px;
	border-radius: 3px;
	display: inline-block;
}

.am-legend-swatch.is-avail {
	background: var(--am-avail-bg);
	border-left: 3px solid var(--am-avail-border);
}

.am-legend-swatch.is-booked {
	background: var(--am-booked-bg);
	border-left: 3px solid #9aa0a6;
}

.am-legend-swatch.is-selected {
	background: var(--am-primary);
}

.am-gcal-info-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 20px;
	background: var(--am-warning-bg);
	border-bottom: 1px solid #fdd663;
	font-size: 13px;
	color: #7c4a03;
}

/* Scrollable Grid Wrapper */
.am-gcal-scroll {
	overflow-x: auto;
	background: #ffffff;
}

.am-gcal-grid {
	min-width: 720px;
}

/* Day Headers (Google Calendar Style) */
.am-gcal-header {
	display: grid;
	grid-template-columns: 64px repeat(7, 1fr);
	border-bottom: 1px solid var(--am-border);
	background: #ffffff;
	position: sticky;
	top: 0;
	z-index: 4;
}

.am-gcal-gutter-head {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 8px 4px;
	font-size: 10px;
	color: var(--am-muted);
	border-right: 1px solid var(--am-grid-line);
}

.am-gcal-day-head {
	text-align: center;
	padding: 10px 4px 8px;
	border-right: 1px solid var(--am-grid-line);
}

.am-gcal-day-head:last-child {
	border-right: none;
}

.am-gcal-day-short {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.6px;
	color: var(--am-muted);
	text-transform: uppercase;
}

.am-gcal-day-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin-top: 3px;
	font-size: 20px;
	font-weight: 400;
	color: var(--am-text);
	border-radius: 50%;
}

.am-gcal-day-head.is-today .am-gcal-day-short {
	color: var(--am-primary);
}

.am-gcal-day-head.is-today .am-gcal-day-num {
	background: var(--am-primary);
	color: #ffffff;
	font-weight: 600;
}

.am-gcal-day-closed-tag {
	display: block;
	font-size: 10px;
	color: var(--am-danger);
	margin-top: 2px;
	font-weight: 600;
}

/* Time Body */
.am-gcal-body {
	display: grid;
	grid-template-columns: 64px repeat(7, 1fr);
	position: relative;
}

.am-gcal-time-col {
	position: relative;
	border-right: 1px solid var(--am-grid-line);
	background: #ffffff;
}

.am-gcal-hour-label {
	position: absolute;
	left: 0;
	right: 8px;
	text-align: right;
	font-size: 11px;
	color: var(--am-muted);
	transform: translateY(-7px);
	user-select: none;
}

.am-gcal-day-col {
	position: relative;
	border-right: 1px solid var(--am-grid-line);
	background: #ffffff;
}

.am-gcal-day-col:last-child {
	border-right: none;
}

.am-gcal-day-col.is-closed-col {
	background: repeating-linear-gradient(
		-45deg,
		#f8f9fa,
		#f8f9fa 8px,
		#f1f3f4 8px,
		#f1f3f4 16px
	);
}

.am-gcal-hour-line {
	position: absolute;
	left: 0;
	right: 0;
	border-top: 1px solid var(--am-grid-line);
	pointer-events: none;
}

.am-gcal-half-line {
	position: absolute;
	left: 0;
	right: 0;
	border-top: 1px dashed #f1f3f4;
	pointer-events: none;
}

/* Red current time line (Google Calendar signature) */
.am-gcal-now-line {
	position: absolute;
	left: 0;
	right: 0;
	height: 2px;
	background: #ea4335;
	z-index: 3;
	pointer-events: none;
}

.am-gcal-now-line::before {
	content: "";
	position: absolute;
	left: -5px;
	top: -4px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #ea4335;
}

/* Slot Event Blocks */
.am-gcal-slot {
	position: absolute;
	left: 3px;
	right: 3px;
	border-radius: 5px;
	padding: 3px 6px;
	font-size: 11px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: center;
	line-height: 1.2;
	z-index: 2;
	transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.am-gcal-slot.is-available {
	background: var(--am-avail-bg);
	border: 1px solid #ceead6;
	border-left: 3px solid var(--am-avail-border);
	color: var(--am-avail-text);
	cursor: pointer;
}

.am-gcal-slot.is-available:hover {
	background: #d4edda;
	border-color: var(--am-avail-border);
	box-shadow: 0 2px 6px rgba(30, 142, 62, 0.22);
	transform: translateY(-1px);
	z-index: 3;
}

.am-gcal-slot.is-booked {
	background: var(--am-booked-bg);
	border: 1px solid var(--am-booked-border);
	border-left: 3px solid #9aa0a6;
	color: var(--am-booked-text);
	cursor: not-allowed;
}

.am-gcal-slot.is-past {
	background: #fafafa;
	border: 1px solid #f1f3f4;
	color: #bdc1c6;
	cursor: not-allowed;
}

.am-gcal-slot.is-selected {
	background: var(--am-primary);
	border: 1px solid var(--am-primary-dark);
	border-left: 3px solid #0d47a1;
	color: #ffffff;
	box-shadow: 0 2px 8px rgba(26, 115, 232, 0.35);
	z-index: 3;
}

.am-slot-time {
	font-weight: 700;
	white-space: nowrap;
}

.am-slot-label {
	font-size: 10px;
	opacity: 0.9;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ==========================================================================
   VIEWS: OTP, BOOKING FORM, SUMMARY, MY BOOKINGS
   ========================================================================== */

.am-panel {
	padding: 24px 26px;
}

.am-panel-narrow {
	max-width: 560px;
	margin: 12px auto;
}

.am-step-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 20px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--am-grid-line);
}

.am-step-title {
	margin: 0;
	font-size: 19px;
	font-weight: 600;
}

/* Selected Slot Card */
.am-slot-summary-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	background: var(--am-primary-light);
	border: 1px solid #aecbfa;
	border-radius: 10px;
	margin-bottom: 22px;
}

.am-slot-summary-main {
	font-size: 15px;
	color: #174ea6;
}

.am-slot-summary-main strong {
	color: #0d47a1;
}

/* Forms */
.am-form-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
}

@media (max-width: 640px) {
	.am-form-grid {
		grid-template-columns: 1fr;
	}
	.am-panel {
		padding: 18px 16px;
	}
}

.am-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin-bottom: 14px;
}

.am-field-full {
	grid-column: 1 / -1;
}

.am-field label {
	font-size: 13px;
	font-weight: 600;
	color: #3c4043;
}

.am-field .am-req {
	color: var(--am-danger);
}

.am-field input[type="text"],
.am-field input[type="email"],
.am-field input[type="tel"],
.am-field input[type="number"],
.am-field input[type="date"],
.am-field select,
.am-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #bdc1c6;
	border-radius: 8px;
	font-size: 14px;
	color: var(--am-text);
	background: #ffffff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.am-field input:focus,
.am-field select:focus,
.am-field textarea:focus {
	outline: none;
	border-color: var(--am-primary);
	box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.16);
}

.am-field input[readonly] {
	background: var(--am-surface);
	color: var(--am-muted);
}

.am-field-help {
	font-size: 12px;
	color: var(--am-muted);
}

.am-otp-input {
	font-size: 26px !important;
	letter-spacing: 8px;
	text-align: center;
	font-weight: 700;
	max-width: 240px;
}

.am-section-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--am-text);
	margin: 22px 0 12px;
	padding-bottom: 6px;
	border-bottom: 1px solid var(--am-grid-line);
}

/* Upload Cards */
.am-doc-upload-card {
	border: 1px dashed #bdc1c6;
	border-radius: 10px;
	padding: 14px 16px;
	background: var(--am-surface);
	margin-bottom: 12px;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.am-doc-upload-card.has-file {
	border-style: solid;
	border-color: var(--am-avail-border);
	background: #f4fbf6;
}

.am-doc-upload-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 4px;
}

.am-doc-upload-name {
	font-weight: 600;
	font-size: 14px;
}

.am-doc-badge {
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 999px;
	font-weight: 600;
}

.am-doc-badge.is-req {
	background: var(--am-danger-bg);
	color: var(--am-danger);
}

.am-doc-badge.is-opt {
	background: #e8eaed;
	color: var(--am-muted);
}

.am-doc-meta {
	font-size: 12px;
	color: var(--am-muted);
	margin-bottom: 8px;
}

.am-doc-existing {
	font-size: 12px;
	color: var(--am-primary);
	margin-bottom: 8px;
}

.am-privacy-box {
	background: var(--am-surface);
	border: 1px solid var(--am-grid-line);
	border-radius: 8px;
	padding: 12px 14px;
	margin: 18px 0;
	font-size: 13px;
}

.am-privacy-box label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	font-weight: 400;
}

.am-form-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 20px;
	flex-wrap: wrap;
}

/* Booking Summary & Cards */
.am-summary-card {
	border: 1px solid var(--am-border);
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 16px;
	background: #ffffff;
}

.am-summary-card-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 14px 18px;
	background: var(--am-surface);
	border-bottom: 1px solid var(--am-grid-line);
}

.am-booking-code {
	font-size: 15px;
	font-weight: 700;
	color: var(--am-text);
}

.am-status-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
}

.am-status-confirmed { background: #e6f4ea; color: #137333; }
.am-status-modified  { background: #fef7e0; color: #b06000; }
.am-status-completed { background: #e8f0fe; color: #1967d2; }
.am-status-cancelled { background: #fce8e6; color: #c5221f; }

.am-summary-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
	padding: 16px 18px;
}

.am-summary-item-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: var(--am-muted);
	font-weight: 600;
}

.am-summary-item-val {
	font-size: 14px;
	color: var(--am-text);
	margin-top: 2px;
	word-break: break-word;
}

.am-summary-docs {
	padding: 12px 18px;
	border-top: 1px solid var(--am-grid-line);
	background: #fafafa;
}

.am-doc-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	background: #ffffff;
	border: 1px solid var(--am-border);
	border-radius: 6px;
	font-size: 12px;
	color: var(--am-primary);
	text-decoration: none;
	margin: 4px 6px 0 0;
}

.am-doc-chip:hover {
	background: var(--am-primary-light);
	border-color: var(--am-primary);
}

.am-summary-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	padding: 12px 18px;
	border-top: 1px solid var(--am-grid-line);
	background: #ffffff;
}

.am-cancel-box {
	padding: 14px 18px;
	background: var(--am-danger-bg);
	border-top: 1px solid #f6aea9;
}

.am-cancel-box textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #f6aea9;
	border-radius: 6px;
	margin: 8px 0 10px;
	font-size: 13px;
}
