/* RT Manager — modulo d'ordine pubblico.
 *
 * Vive fuori dal gestionale, su una pagina qualunque del sito: ogni regola è
 * scritta per resistere al tema. Selettori sempre discendenti da .rtm-ordine,
 * proprietà dichiarate per intero, colori espliciti, nessuna eredità sperata.
 */

.rtm-ordine {
	--rtmo-bordo: #e2e6ec;
	--rtmo-testo: #1e2733;
	--rtmo-tenue: #6b7684;
	--rtmo-blu: #2563eb;
	--rtmo-blu-scuro: #1d4ed8;
	--rtmo-verde: #15803d;
	--rtmo-rosso: #b91c1c;
	--rtmo-ambra: #b45309;

	box-sizing: border-box;
	max-width: 780px;
	margin: 0 auto;
	padding: 0;
	color: var(--rtmo-testo);
	font-size: 15px;
	line-height: 1.55;
	text-align: left;
}

.rtm-ordine *,
.rtm-ordine *::before,
.rtm-ordine *::after { box-sizing: border-box; }

.rtm-ordine h2,
.rtm-ordine h3 { margin: 0 0 6px; color: var(--rtmo-testo); line-height: 1.25; font-weight: 650; }
.rtm-ordine h2 { font-size: 23px; }
.rtm-ordine h3 { font-size: 17px; }
.rtm-ordine p { margin: 0 0 10px; }
.rtm-ordine a { color: var(--rtmo-blu); }

.rtm-ordine-titolo { margin-bottom: 4px; }
.rtm-ordine-sottotitolo { color: var(--rtmo-tenue); margin-bottom: 20px; font-size: 15px; }

/* Il prodotto e il prezzo, in testa */
.rtm-ordine-prodotto {
	display: flex;
	gap: 20px;
	align-items: flex-start;
	justify-content: space-between;
	flex-wrap: wrap;
	padding: 18px 20px;
	border: 1px solid var(--rtmo-bordo);
	border-radius: 12px;
	background: #f8fafc;
	margin-bottom: 20px;
}
.rtm-ordine-prodotto-testo { flex: 1 1 320px; min-width: 0; }
.rtm-ordine-prodotto-testo p { margin: 0; color: var(--rtmo-tenue); font-size: 13.5px; }
.rtm-ordine-prezzo { text-align: right; flex: 0 0 auto; }
.rtm-ordine-prezzo strong { display: block; font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--rtmo-testo); }
.rtm-ordine-prezzo span { display: block; font-size: 12.5px; color: var(--rtmo-tenue); }

/* Il modulo */
.rtm-ordine-form fieldset {
	border: 1px solid var(--rtmo-bordo);
	border-radius: 12px;
	padding: 16px 18px 18px;
	margin: 0 0 18px;
	background: #fff;
}
.rtm-ordine-form legend {
	padding: 0 8px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--rtmo-tenue);
}

.rtm-ordine-griglia {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
}
.rtm-ordine-campo { display: flex; flex-direction: column; grid-column: span 2; min-width: 0; }
.rtm-ordine-largo { grid-column: 1 / -1; }
.rtm-ordine-stretto { grid-column: span 1; }
@media (max-width: 640px) {
	.rtm-ordine-griglia { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.rtm-ordine-campo { grid-column: 1 / -1; }
	.rtm-ordine-stretto { grid-column: span 1; }
}

.rtm-ordine label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #41505f; }
.rtm-ordine .rtm-req { color: var(--rtmo-rosso); font-weight: 700; }

.rtm-ordine input[type="text"],
.rtm-ordine input[type="email"],
.rtm-ordine input[type="tel"],
.rtm-ordine input[type="number"],
.rtm-ordine select,
.rtm-ordine textarea {
	width: 100%;
	max-width: 100%;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	background: #fff;
	color: var(--rtmo-testo);
	font-family: inherit;
	font-size: 14.5px;
	line-height: 1.4;
	margin: 0;
	box-shadow: none;
}
.rtm-ordine textarea { resize: vertical; min-height: 76px; }
.rtm-ordine input:focus,
.rtm-ordine select:focus,
.rtm-ordine textarea:focus {
	outline: none;
	border-color: var(--rtmo-blu);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.rtm-ordine-aiuto { font-size: 12.5px; color: var(--rtmo-tenue); margin: 0; line-height: 1.5; }
.rtm-ordine-centro { text-align: center; margin-top: 12px; }

/* Metodi di pagamento */
.rtm-ordine-metodi { display: grid; gap: 10px; }
.rtm-ordine-metodo {
	display: flex;
	gap: 11px;
	align-items: flex-start;
	padding: 13px 15px;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	cursor: pointer;
	margin: 0;
	font-weight: 400;
	transition: border-color .12s, background .12s;
}
.rtm-ordine-metodo:hover { border-color: var(--rtmo-blu); background: #f8fbff; }
.rtm-ordine-metodo input { margin: 3px 0 0; flex: 0 0 auto; width: auto; }
.rtm-ordine-metodo-corpo { display: block; min-width: 0; }
.rtm-ordine-metodo strong { display: block; font-size: 14.5px; color: var(--rtmo-testo); }
.rtm-ordine-metodo small { display: block; font-size: 12.5px; color: var(--rtmo-tenue); line-height: 1.45; margin-top: 2px; }
.rtm-ordine-metodo:has(input:checked) { border-color: var(--rtmo-blu); background: #f2f7ff; box-shadow: 0 0 0 1px var(--rtmo-blu) inset; }

/* I conti */
.rtm-ordine-conti {
	border: 1px solid var(--rtmo-bordo);
	border-radius: 12px;
	padding: 14px 18px;
	background: #f8fafc;
	margin-bottom: 18px;
}
.rtm-ordine-conti > div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; font-size: 14px; color: var(--rtmo-tenue); }
.rtm-ordine-conti strong { color: var(--rtmo-testo); font-weight: 600; font-variant-numeric: tabular-nums; }
.rtm-ordine-conti-riga { border-bottom: 1px dashed var(--rtmo-bordo); margin-bottom: 6px; padding-bottom: 8px !important; font-size: 13px !important; }
.rtm-ordine-conti-tot { border-top: 1px solid var(--rtmo-bordo); margin-top: 6px; padding-top: 10px !important; font-size: 17px !important; color: var(--rtmo-testo) !important; }
.rtm-ordine-conti-tot strong { font-size: 20px; font-weight: 700; }
.rtm-ordine-nota-iva { margin: 8px 0 0; font-size: 12.5px; color: var(--rtmo-ambra); line-height: 1.45; }

/* Consensi */
.rtm-ordine-consensi { display: grid; gap: 10px; margin-bottom: 18px; }
.rtm-ordine-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; font-weight: 400; color: #41505f; margin: 0; line-height: 1.5; }
.rtm-ordine-check input { margin: 3px 0 0; width: auto; flex: 0 0 auto; }

.rtm-ordine-invia {
	display: block;
	width: 100%;
	padding: 15px 22px;
	border: 0;
	border-radius: 10px;
	background: var(--rtmo-blu);
	color: #fff;
	font-family: inherit;
	font-size: 16px;
	font-weight: 650;
	cursor: pointer;
	transition: background .12s;
}
.rtm-ordine-invia:hover { background: var(--rtmo-blu-scuro); }

/* Esito */
.rtm-ordine-esito {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 18px 20px;
	border: 1px solid;
	border-radius: 12px;
	margin-bottom: 18px;
}
.rtm-ordine-esito h2 { font-size: 19px; margin-bottom: 3px; }
.rtm-ordine-esito p { margin: 0; font-size: 14px; }
.rtm-ordine-segno {
	flex: 0 0 auto;
	width: 34px; height: 34px;
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-size: 19px; font-weight: 700; color: #fff;
}
.rtm-ordine-ok { border-color: #bbf7d0; background: #f0fdf4; }
.rtm-ordine-ok .rtm-ordine-segno { background: var(--rtmo-verde); }
.rtm-ordine-attesa { border-color: #fde68a; background: #fffbeb; }
.rtm-ordine-attesa .rtm-ordine-segno { background: var(--rtmo-ambra); }
.rtm-ordine-ko { border-color: #fecaca; background: #fef2f2; }
.rtm-ordine-ko .rtm-ordine-segno { background: var(--rtmo-rosso); }

.rtm-ordine-errore {
	padding: 12px 15px;
	border: 1px solid #fecaca;
	border-left: 4px solid var(--rtmo-rosso);
	border-radius: 8px;
	background: #fef2f2;
	color: #7f1d1d;
	font-size: 14px;
	margin-bottom: 18px;
}

.rtm-ordine-riepilogo { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.rtm-ordine-riepilogo th,
.rtm-ordine-riepilogo td { padding: 9px 0; border-bottom: 1px solid #f1f5f9; text-align: left; font-size: 14.5px; font-weight: 400; }
.rtm-ordine-riepilogo td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rtm-ordine-totale th,
.rtm-ordine-totale td { font-weight: 700; font-size: 17px; border-bottom: 0; }

/* Coordinate del bonifico */
.rtm-ordine-bonifico {
	border: 1px solid var(--rtmo-bordo);
	border-radius: 12px;
	padding: 16px 20px;
	background: #f8fafc;
	margin-bottom: 18px;
}
.rtm-ordine-bonifico dl { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 6px 16px; margin: 0 0 10px; }
.rtm-ordine-bonifico dt { font-size: 12.5px; font-weight: 600; color: var(--rtmo-tenue); margin: 0; }
.rtm-ordine-bonifico dd { margin: 0; font-size: 14px; color: var(--rtmo-testo); word-break: break-word; }
.rtm-ordine-evidenza { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14.5px !important; font-weight: 700; letter-spacing: .02em; }
.rtm-ordine-nota { font-size: 12.5px; color: var(--rtmo-tenue); margin: 0; line-height: 1.5; }
.rtm-ordine-nota-avviso { color: var(--rtmo-ambra); margin-bottom: 14px; }

/* La trappola resta invisibile anche se questo foglio non arrivasse mai */
.rtm-ordine-trappola { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

/* ==========================================================================
   Documenti legali: condizioni di vendita, informativa privacy
   ========================================================================== */
.rtm-doc { max-width: 820px; }
.rtm-doc-intestazione {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	padding: 0 0 14px;
	margin: 0 0 22px;
	border-bottom: 1px solid var(--rtmo-bordo);
	font-size: 13px;
	color: var(--rtmo-tenue);
}

.rtm-doc-indice {
	padding: 16px 20px;
	border: 1px solid var(--rtmo-bordo);
	border-radius: 12px;
	background: #f8fafc;
	margin-bottom: 26px;
}
.rtm-doc-indice ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; }
.rtm-doc-indice li { margin: 0 0 5px; font-size: 13.5px; break-inside: avoid; }
.rtm-doc-indice a { color: var(--rtmo-testo); text-decoration: none; }
.rtm-doc-indice a:hover { color: var(--rtmo-blu); text-decoration: underline; }
@media (max-width: 640px) { .rtm-doc-indice ol { columns: 1; } }

.rtm-doc-sezione { margin: 0 0 26px; scroll-margin-top: 24px; }
.rtm-doc-sezione h3 {
	font-size: 16.5px;
	margin: 0 0 9px;
	padding-bottom: 7px;
	border-bottom: 1px solid #f1f5f9;
	color: var(--rtmo-testo);
}
.rtm-doc-sezione p { margin: 0 0 11px; font-size: 14.5px; line-height: 1.65; }
.rtm-doc-sezione ul { margin: 0 0 11px; padding-left: 22px; }
.rtm-doc-sezione li { margin: 0 0 7px; font-size: 14.5px; line-height: 1.6; }
.rtm-doc-sezione strong { font-weight: 650; }

.rtm-doc-tabella { overflow-x: auto; margin: 0 0 14px; -webkit-overflow-scrolling: touch; }
.rtm-doc-tabella table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 13px; }
.rtm-doc-tabella th,
.rtm-doc-tabella td {
	padding: 10px 12px;
	border: 1px solid var(--rtmo-bordo);
	text-align: left;
	vertical-align: top;
	line-height: 1.5;
}
.rtm-doc-tabella th { background: #f1f5f9; font-weight: 650; font-size: 12.5px; color: #41505f; }
.rtm-doc-tabella tbody tr:nth-child(odd) td { background: #fbfcfe; }

@media print {
	.rtm-doc-indice { display: none; }
	.rtm-doc-sezione { break-inside: avoid; }
	.rtm-doc-tabella table { min-width: 0; font-size: 10pt; }
}

/* Il motivo tecnico sotto l'avviso: leggibile ma chiaramente secondario
   rispetto al messaggio rivolto al cliente. */
.rtm-ordine-motivo {
	display: inline-block;
	margin-top: 4px;
	font-size: 12px;
	line-height: 1.5;
	opacity: .8;
	word-break: break-word;
}
