/* =========================================================
   MC CLUB - Attivazione Travel Pass
   Grafica "carta d'imbarco" - richiede Bootstrap 5.3
   ========================================================= */

:root {
	--tp-navy:   #0E2F5A;   /* blu Adriatico: testi e titoli */
	--tp-sea:    #1F6FD1;   /* azzurro mare: azioni */
	--tp-sea-dk: #175BB0;
	--tp-sky:    #EAF2FB;   /* sfondo pagina */
	--tp-line:   #CFDCEC;   /* bordi e perforazione */
	--tp-muted:  #5B6B80;   /* testo secondario */
	--tp-sun:    #F5B83D;   /* unico accento */
	--tp-ok:     #1E8E5A;
	--tp-err:    #C2412D;
	--tp-white:  #FFFFFF;

	--tp-font-title: "Bricolage Grotesque", system-ui, sans-serif;
	--tp-font-body:  "Figtree", system-ui, sans-serif;

	--bs-body-font-family: var(--tp-font-body);
	--bs-body-color: var(--tp-navy);
	--bs-primary: var(--tp-sea);
	--bs-primary-rgb: 31, 111, 209;
	--bs-link-color: var(--tp-sea);
	--bs-link-hover-color: var(--tp-sea-dk);
}

body {
	background: var(--tp-sky);
	color: var(--tp-navy);
	font-family: var(--tp-font-body);
	font-size: 1rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, .tp-title {
	font-family: var(--tp-font-title);
	color: var(--tp-navy);
	letter-spacing: -0.015em;
}

a { text-decoration-thickness: 1px; text-underline-offset: 3px; }

:focus-visible {
	outline: 3px solid var(--tp-sun);
	outline-offset: 2px;
}

/* ---------- Barra superiore ---------- */

.tp-topbar {
	padding: 18px 0;
}
.tp-topbar img { height: 44px; width: auto; }
.tp-topbar-help {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	border-radius: 999px;
	background: var(--tp-white);
	color: var(--tp-navy);
	font-weight: 600;
	font-size: .9rem;
	text-decoration: none;
	border: 1px solid var(--tp-line);
}
.tp-topbar-help:hover { border-color: var(--tp-sea); color: var(--tp-sea); }

/* ---------- Hero pagina iniziale ---------- */

.tp-hero { padding-top: 32px; padding-bottom: 56px; }

.tp-hero h1 {
	font-size: clamp(2.2rem, 5vw, 3.5rem);
	font-weight: 700;
	line-height: 1.05;
	margin-bottom: 20px;
	max-width: 12ch;
}

.tp-code-error { display: none; color: var(--tp-err); font-size: .85rem; margin: -12px 0 16px; }
.tp-code-error.is-shown { display: block; }

.tp-lead {
	font-size: 1.125rem;
	color: var(--tp-muted);
	max-width: 46ch;
	margin-bottom: 32px;
}

/* Passaggi della procedura (sequenza reale) */
.tp-steps {
	list-style: none;
	padding: 0;
	margin: 0 0 32px;
	display: grid;
	gap: 14px;
	max-width: 440px;
}
.tp-steps li {
	display: grid;
	grid-template-columns: 36px 1fr;
	gap: 14px;
	align-items: center;
	font-weight: 500;
}
.tp-steps b {
	width: 36px; height: 36px;
	border-radius: 50%;
	display: grid; place-items: center;
	background: var(--tp-white);
	border: 1.5px solid var(--tp-line);
	font-family: var(--tp-font-title);
	font-size: .95rem;
}
.tp-steps li:first-child b {
	background: var(--tp-navy);
	border-color: var(--tp-navy);
	color: var(--tp-white);
}

.tp-hero-photo {
	max-width: 420px;
	width: 100%;
	height: auto;
	border-radius: 16px;
}

/* ---------- Biglietto (elemento distintivo) ---------- */

.tp-ticket {
	position: relative;
	overflow: hidden;      /* le tacche diventano intagli nel biglietto */
	background: var(--tp-white);
	border-radius: 24px;
	box-shadow: 0 1px 0 var(--tp-line), 0 24px 48px -24px rgba(14, 47, 90, .35);
	max-width: 480px;
	margin-left: auto;
	margin-right: auto;
}

.tp-ticket-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 28px;
	background: var(--tp-navy);
	color: var(--tp-white);
	border-radius: 24px 24px 0 0;
}
.tp-ticket-head strong {
	font-family: var(--tp-font-title);
	font-size: 1.15rem;
	font-weight: 600;
}
.tp-ticket-head i { color: var(--tp-sun); font-size: 1.4rem; }

.tp-ticket-body { padding: 28px; }

/* Linea di strappo con le due "tacche" laterali */
.tp-perf {
	position: relative;
	height: 0;
	margin: 0 28px;
	border-top: 2px dashed var(--tp-line);
}
.tp-perf::before,
.tp-perf::after {
	content: "";
	position: absolute;
	top: -15px;
	width: 28px; height: 28px;
	border-radius: 50%;
	background: var(--tp-sky);
}
.tp-perf::before { left: -43px; }
.tp-perf::after  { right: -43px; }

.tp-ticket-stub {
	padding: 20px 28px 24px;
	font-size: .9rem;
	color: var(--tp-muted);
	display: flex;
	gap: 12px;
	align-items: flex-start;
}
.tp-ticket-stub i { color: var(--tp-sea); font-size: 1.1rem; margin-top: 2px; }

/* Campo codice stile biglietto */
.tp-code {
	display: grid;
	grid-template-columns: 1fr 22px 1.6fr;
	align-items: end;
	gap: 6px;
	margin-bottom: 24px;
}
.tp-code-dash {
	font-family: var(--tp-font-title);
	font-size: 1.8rem;
	color: var(--tp-line);
	text-align: center;
	padding-bottom: 6px;
}
.tp-code .form-control {
	font-family: var(--tp-font-title);
	font-size: 1.5rem;
	font-weight: 600;
	letter-spacing: .06em;
	height: 64px;
	text-align: center;
}
.tp-code .form-control::placeholder { font-weight: 400; letter-spacing: .02em; font-size: 1.1rem; }

/* Animazione di entrata del biglietto (una sola) */
@media (prefers-reduced-motion: no-preference) {
	.tp-ticket--enter {
		animation: tp-board .7s cubic-bezier(.2, .8, .2, 1) both .1s;
	}
	@keyframes tp-board {
		from { opacity: 0; transform: translateY(24px) rotate(-2deg); }
		to   { opacity: 1; transform: none; }
	}
}

/* ---------- Campi form ---------- */

.form-label {
	font-weight: 600;
	font-size: .9rem;
	color: var(--tp-navy);
	margin-bottom: 6px;
}
.form-label .tp-opt { font-weight: 400; color: var(--tp-muted); }

.form-control,
.form-select {
	height: 52px;
	border: 1.5px solid var(--tp-line);
	border-radius: 12px;
	background-color: var(--tp-white);
	color: var(--tp-navy);
	font-size: 1rem;
}
.form-control:focus,
.form-select:focus {
	border-color: var(--tp-sea);
	box-shadow: 0 0 0 4px rgba(31, 111, 209, .15);
}
.was-validated .form-control:invalid,
.was-validated .form-select:invalid { border-color: var(--tp-err); }
.invalid-feedback { color: var(--tp-err); font-size: .85rem; }

/* ---------- Pulsanti ---------- */

.btn-tp {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	width: 100%;
	height: 56px;
	border: 0;
	border-radius: 14px;
	background: var(--tp-sea);
	color: var(--tp-white);
	font-family: var(--tp-font-title);
	font-weight: 600;
	font-size: 1.1rem;
	text-decoration: none;
	transition: background-color .15s;
}
.btn-tp:hover,
.btn-tp:focus-visible { background: var(--tp-sea-dk); color: var(--tp-white); }

.btn-tp-ghost {
	background: transparent;
	color: var(--tp-navy);
	border: 1.5px solid var(--tp-line);
}
.btn-tp-ghost:hover { background: var(--tp-white); color: var(--tp-navy); border-color: var(--tp-navy); }

/* ---------- Form dati (passo 2) ---------- */

.tp-progress {
	display: flex;
	gap: 8px;
	list-style: none;
	padding: 0;
	margin: 8px 0 28px;
	font-size: .9rem;
	color: var(--tp-muted);
	flex-wrap: wrap;
}
.tp-progress li { display: flex; align-items: center; gap: 8px; }
.tp-progress li + li::before {
	content: "";
	width: 24px;
	height: 2px;
	background: var(--tp-line);
	margin-right: 4px;
}
.tp-progress b {
	width: 26px; height: 26px;
	border-radius: 50%;
	display: grid; place-items: center;
	font-size: .8rem;
	border: 1.5px solid var(--tp-line);
	background: var(--tp-white);
}
.tp-progress .is-done b   { background: var(--tp-sea); border-color: var(--tp-sea); color: var(--tp-white); }
.tp-progress .is-active   { color: var(--tp-navy); font-weight: 600; }
.tp-progress .is-active b { background: var(--tp-navy); border-color: var(--tp-navy); color: var(--tp-white); }

.tp-page-title {
	font-size: clamp(1.8rem, 4vw, 2.5rem);
	font-weight: 700;
	line-height: 1.1;
	margin-bottom: 10px;
}

.tp-sheet {
	background: var(--tp-white);
	border-radius: 24px;
	padding: 8px 32px 32px;
	box-shadow: 0 1px 0 var(--tp-line);
}

.tp-fieldset {
	border: 0;
	padding: 28px 0 4px;
	margin: 0;
}
.tp-fieldset + .tp-fieldset { border-top: 1px solid var(--tp-sky); }
.tp-fieldset legend {
	font-family: var(--tp-font-title);
	font-size: 1.25rem;
	font-weight: 600;
	margin-bottom: 4px;
	padding: 0;
	float: left;          /* legenda come elemento normale (niente spazio sotto) */
	width: 100%;
	line-height: 1.3;
}
.tp-fieldset legend + * { clear: left; }
.tp-fieldset .tp-hint {
	color: var(--tp-muted);
	font-size: .9rem;
	margin-bottom: 18px;
}

.tp-alert {
	display: flex;
	gap: 14px;
	padding: 18px 20px;
	border-radius: 16px;
	background: #FFF6E3;
	border: 1px solid #F3D9A0;
	margin-bottom: 24px;
}
.tp-alert i { color: #B7801A; font-size: 1.3rem; }
.tp-alert p { margin: 0; }

.tp-privacy {
	font-size: .85rem;
	color: var(--tp-muted);
	padding: 20px 0;
	border-top: 1px solid var(--tp-sky);
	margin-top: 12px;
}

.tp-code-help {
	border-radius: 14px;
	width: 100%;
	height: auto;
}

/* ---------- Assistenza ---------- */

.tp-help { padding: 48px 0 24px; }
.tp-help h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 4px; }
.tp-help p.tp-hint { color: var(--tp-muted); margin-bottom: 20px; }

.tp-contact {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 18px;
	border-radius: 16px;
	background: var(--tp-white);
	border: 1px solid transparent;
	text-decoration: none;
	color: var(--tp-navy);
	height: 100%;
}
.tp-contact:hover { border-color: var(--tp-sea); color: var(--tp-navy); }
.tp-contact-icon {
	flex: 0 0 44px;
	width: 44px; height: 44px;
	border-radius: 12px;
	display: grid; place-items: center;
	background: var(--tp-sky);
	color: var(--tp-sea);
	font-size: 1.25rem;
}
.tp-contact-text strong { display: block; font-weight: 600; line-height: 1.3; }
.tp-contact-text small  { display: block; font-size: .85rem; color: var(--tp-muted); word-break: break-word; }

/* ---------- Schermate di esito ---------- */

.tp-esito {
	padding-top: 24px;
	padding-bottom: 48px;
}
.tp-esito-card {
	background: var(--tp-white);
	border-radius: 24px;
	max-width: 560px;
	margin: 0 auto;
	padding: 40px 32px 32px;
	text-align: center;
	box-shadow: 0 1px 0 var(--tp-line), 0 24px 48px -28px rgba(14, 47, 90, .3);
}
.tp-esito-icon {
	width: 72px; height: 72px;
	margin: 0 auto 20px;
	border-radius: 50%;
	display: grid; place-items: center;
	font-size: 2.2rem;
	color: var(--tp-white);
	background: var(--tp-sea);
}
.tp-esito--ok     .tp-esito-icon { background: var(--tp-ok); }
.tp-esito--errore .tp-esito-icon { background: var(--tp-err); }

.tp-esito h1 {
	font-size: clamp(1.6rem, 4vw, 2.1rem);
	font-weight: 700;
	line-height: 1.15;
	margin-bottom: 12px;
}
.tp-esito-text {
	color: var(--tp-muted);
	max-width: 42ch;
	margin: 0 auto 24px;
}

/* Riepilogo come tagliando del biglietto */
.tp-receipt {
	text-align: left;
	background: var(--tp-sky);
	border-radius: 16px;
	padding: 6px 20px;
	margin-bottom: 24px;
}
.tp-receipt div {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 0;
	font-size: .95rem;
}
.tp-receipt div + div { border-top: 1px dashed var(--tp-line); }
.tp-receipt dt { font-weight: 400; color: var(--tp-muted); }
.tp-receipt dd { margin: 0; font-weight: 600; text-align: right; word-break: break-word; }

.tp-esito-help {
	font-size: .9rem;
	color: var(--tp-muted);
	margin-top: 20px;
}

.tp-countdown {
	height: 4px;
	border-radius: 4px;
	background: var(--tp-sky);
	overflow: hidden;
	margin: 20px 0 8px;
}
.tp-countdown span {
	display: block;
	height: 100%;
	background: var(--tp-sea);
	transform-origin: left;
	animation: tp-count var(--secs, 5s) linear forwards;
}
@keyframes tp-count { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .tp-countdown span { animation: none; } }

/* ---------- Footer ---------- */

.tp-footer {
	padding: 40px 0 48px;
	margin-top: 32px;
	border-top: 1px solid var(--tp-line);
	font-size: .85rem;
	color: var(--tp-muted);
}
.tp-footer p { margin-bottom: 6px; }
.tp-footer-logos {
	display: flex;
	align-items: center;
	gap: 24px;
	margin-bottom: 16px;
}

/* ---------- Mobile ---------- */

@media (max-width: 575.98px) {
	.tp-hero { padding-top: 8px; padding-bottom: 32px; }
	.tp-ticket-body, .tp-ticket-stub { padding-left: 20px; padding-right: 20px; }
	.tp-ticket-head { padding: 16px 20px; }
	.tp-perf { margin: 0 20px; }
	.tp-perf::before { left: -35px; }
	.tp-perf::after  { right: -35px; }
	.tp-sheet { padding: 4px 20px 24px; border-radius: 20px; }
	.tp-esito-card { padding: 32px 20px 24px; }
	.tp-topbar img { height: 36px; }
}

/* Segnaposto chiaramente distinguibili dai valori inseriti */
.form-control::placeholder { color: #9AA8BA; opacity: 1; }
.tp-ticket-stub strong { white-space: nowrap; }
