/* Baobab Satélite — formulario público y página de confirmación.
   Colores ajustables en un solo sitio: */
.cm-congreso-form,
.cm-confirmacion {
	--cm-primary: #1f5c46;
	--cm-primary-dark: #174837;
	--cm-accent: #c9892b;
	--cm-border: #d0d5d2;
	--cm-text: #1d2327;
	--cm-muted: #646970;
	--cm-radius: 10px;
	--cm-card-radius: 18px;
	--cm-error: #b32d2e;
}

/* ---------- Tarjeta del formulario ---------- */
.cm-congreso-form {
	max-width: 820px;
	margin: 0 auto 2em;
	padding: 2em 2.25em;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, .06);
	border-radius: var(--cm-card-radius);
	box-shadow: 0 6px 24px rgba(15, 23, 42, .08);
	color: var(--cm-text);
	font-size: 16px;
}
.cm-congreso-form * { box-sizing: border-box; }
@media (max-width: 640px) {
	.cm-congreso-form { padding: 1.25em; border-radius: 14px; }
}

.cm-required-note { margin: 0 0 1.5em; font-size: .9em; color: var(--cm-muted); }

/* ---------- Campos ---------- */
.cm-field { margin-bottom: 1.25em; }
.cm-field > label { display: block; font-weight: 600; margin-bottom: .35em; }
.cm-required { color: var(--cm-error); font-weight: 700; }

/* Campo obligatorio sin rellenar (tras pulsar el botón) */
.cm-congreso-form .cm-invalid {
	border-color: var(--cm-error) !important;
	box-shadow: 0 0 0 3px rgba(179, 45, 46, .12) !important;
}
.cm-field.cm-has-error > label { color: var(--cm-error); }
.cm-field-error { display: block; margin-top: .35em; font-size: .85em; color: var(--cm-error); }
.cm-field-terms.cm-has-error { box-shadow: 0 0 0 2px var(--cm-error) inset; }

.cm-congreso-form input[type="text"],
.cm-congreso-form input[type="email"],
.cm-congreso-form input[type="tel"],
.cm-congreso-form input[type="number"],
.cm-congreso-form input[type="date"],
.cm-congreso-form select,
.cm-congreso-form textarea {
	width: 100%;
	padding: .6em .75em;
	border: 1px solid var(--cm-border);
	border-radius: var(--cm-radius);
	background: #fff;
	font: inherit;
	color: inherit;
	transition: border-color .15s, box-shadow .15s;
}
.cm-congreso-form textarea { min-height: 130px; resize: vertical; }
.cm-congreso-form input:focus,
.cm-congreso-form select:focus,
.cm-congreso-form textarea:focus {
	outline: none;
	border-color: var(--cm-primary);
	box-shadow: 0 0 0 3px rgba(31, 92, 70, .15);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--cm-primary) 15%, transparent);
}

.cm-help,
.cm-sublabel { display: block; font-size: .85em; color: var(--cm-muted); margin: .3em 0 0; }
.cm-char-count { text-align: right; font-size: .8em; color: var(--cm-muted); margin-top: .25em; }
.cm-email-confirm { margin-top: .6em; }

.cm-field-heading h3 { margin: 1.2em 0 .3em; padding-bottom: .3em; border-bottom: 2px solid var(--cm-accent); font-size: 1.15em; }

.cm-inline-option { display: flex; align-items: center; gap: .5em; margin: .3em 0; font-weight: normal; cursor: pointer; }
.cm-inline-option input { margin: 0; }

.cm-name-row { display: flex; gap: 1em; }
.cm-name-col { flex: 1; }

/* ---------- Disposición: etiqueta a la izquierda ---------- */
@media (min-width: 700px) {
	.cm-layout-side .cm-field:not(.cm-field-heading):not(.cm-field-terms) { display: grid; grid-template-columns: 220px 1fr; gap: 1em; align-items: start; }
	.cm-layout-side .cm-field > label { margin: .6em 0 0; }
}

/* ---------- Grupo repetible ---------- */
.cm-repeater { border: 1px solid var(--cm-border); border-radius: var(--cm-radius); padding: .75em; background: #fafbfa; }
.cm-repeater-head,
.cm-repeater-row { display: flex; gap: .5em; align-items: center; }
.cm-repeater-head > span,
.cm-repeater-row > input { flex: 1 1 0; min-width: 0; }
.cm-repeater-head { font-size: .8em; color: var(--cm-muted); font-weight: 600; margin-bottom: .35em; }
.cm-repeater-head > .cm-repeater-spacer,
.cm-repeater-row > .cm-repeater-remove { flex: 0 0 2.4em; width: 2.4em; }
.cm-repeater-row { margin-bottom: .5em; }
.cm-repeater-remove {
	height: 2.4em;
	border: 1px solid var(--cm-border);
	border-radius: var(--cm-radius);
	background: #fff;
	color: #b32d2e;
	cursor: pointer;
}
.cm-repeater-remove:hover { background: #b32d2e; color: #fff; border-color: #b32d2e; }
.cm-repeater.has-one-row .cm-repeater-remove { visibility: hidden; }
.cm-repeater-add {
	margin-top: .25em;
	padding: .5em 1em;
	border: 1px dashed var(--cm-primary);
	border-radius: var(--cm-radius);
	background: transparent;
	color: var(--cm-primary);
	font: inherit;
	font-size: .9em;
	cursor: pointer;
}
.cm-repeater-add:hover { background: rgba(31, 92, 70, .06); background: color-mix(in srgb, var(--cm-primary) 6%, transparent); }
.cm-repeater-add:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 640px) {
	.cm-name-row { flex-direction: column; gap: .6em; }
	.cm-repeater-head { display: none; }
	.cm-repeater-row { display: flex; flex-direction: column; align-items: stretch; padding: .6em; border: 1px solid var(--cm-border); border-radius: var(--cm-radius); background: #fff; }
	.cm-repeater-row > input { flex: none; }
	.cm-repeater-row .cm-repeater-remove { width: auto; flex: none; }
}

/* ---------- Términos, total y botón ---------- */
.cm-field-terms { padding: .8em 1em; background: #f6f7f7; border-radius: var(--cm-radius); }
.cm-field-terms a { color: var(--cm-primary); }

.cm-form-total-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 1.5em 0 1em;
	padding: 1em 1.25em;
	border-radius: var(--cm-radius);
	background: #f0f6f3;
	background: color-mix(in srgb, var(--cm-primary) 7%, #fff);
	border-left: 4px solid var(--cm-primary);
	font-size: 1.05em;
}
.cm-form-total-value { font-size: 1.4em; font-weight: 700; color: var(--cm-primary); }

.cm-form-submit {
	display: inline-block;
	min-width: 220px;
	padding: .85em 1.8em;
	border: 0;
	border-radius: var(--cm-radius);
	background: var(--cm-primary);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(15, 23, 42, .15);
	transition: background .15s, box-shadow .15s, transform .1s;
}
.cm-form-submit:hover { background: var(--cm-primary-dark); box-shadow: 0 4px 14px rgba(15, 23, 42, .2); }
.cm-form-submit:active { transform: translateY(1px); }
.cm-form-submit:disabled { opacity: .7; cursor: wait; }

/* ---------- Mensajes ---------- */
.cm-form-messages { margin: 1em 0; padding: 1em 1.25em; border-radius: var(--cm-radius); }
.cm-form-messages p { margin: 0 0 .4em; }
.cm-form-messages p:last-child { margin-bottom: 0; }
.cm-form-messages.is-ok { background: #e7f5ec; color: #0a5c2b; border-left: 4px solid #1f8a4c; }
.cm-form-messages.is-error { background: #fbe9e7; color: #8a1f11; border-left: 4px solid #b32d2e; }

/* ---------- Página de confirmación ---------- */
.cm-confirmacion { max-width: 720px; margin: 1.5em auto; }
.cm-confirmacion p { padding: 1.2em 1.4em; border-radius: var(--cm-radius); font-size: 1.05em; }
.cm-status-ok { background: #e7f5ec; color: #0a5c2b; border-left: 4px solid #1f8a4c; }
.cm-status-ko { background: #fbe9e7; color: #8a1f11; border-left: 4px solid #b32d2e; }
.cm-status-ko a { color: inherit; font-weight: 600; }
.cm-status-pending { background: #fcf5e6; color: #7a5200; border-left: 4px solid var(--cm-accent); }
.cm-status-pending:before {
	content: '';
	display: inline-block;
	width: 1em;
	height: 1em;
	margin-right: .6em;
	vertical-align: -2px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: cm-spin .8s linear infinite;
}
@keyframes cm-spin { to { transform: rotate(360deg); } }

/* ---------- Pantalla de carga al enviar / pagar ---------- */
.cm-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(10, 20, 16, .72);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s, visibility .2s;
}
.cm-overlay.is-active { opacity: 1; visibility: visible; }
body.cm-overlay-open { overflow: hidden; }

.cm-overlay-card {
	width: 100%;
	max-width: 420px;
	padding: 2em 1.75em;
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
	text-align: center;
	color: #1d2327;
	font-size: 16px;
}
.cm-overlay-spinner {
	width: 56px;
	height: 56px;
	margin: 0 auto 1.1em;
	border: 5px solid #e3e8e5;
	border-top-color: var(--cm-primary, #1f5c46);
	border-radius: 50%;
	animation: cm-spin .9s linear infinite;
}
.cm-overlay-title { margin: 0 0 .5em; font-size: 1.15em; font-weight: 700; }
.cm-overlay-text { margin: 0; font-size: .95em; line-height: 1.5; color: #50575e; }
.cm-overlay-slow {
	margin: 1em 0 0;
	padding: .7em .9em;
	border-radius: 10px;
	background: #fcf5e6;
	color: #7a5200;
	font-size: .9em;
	line-height: 1.45;
}
.cm-overlay-slow[hidden] { display: none; }

/* Datos de facturación (persona o entidad) */
.cm-billing-tipo { margin-bottom: 10px; }
.cm-billing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
.cm-billing-col input { width: 100%; box-sizing: border-box; }
.cm-billing-full { grid-column: 1 / -1; }
.cm-billing-wide { grid-column: span 2; }
@media (max-width: 640px) {
	.cm-billing-grid { grid-template-columns: 1fr; }
	.cm-billing-wide { grid-column: auto; }
}
