/* Studyteca Inscripción */

.sti-form-wrapper {
	--sti-orange: var(--wp--preset--color--accent-1, #ff8800);
	--sti-orange-dark: #e67a00;
	--sti-green: #2e9e5b;
	--sti-green-dark: #1a7a42;
	--sti-border: var(--wp--preset--color--accent-4, #6b6c7c);
	--sti-bg: var(--wp--preset--color--accent-5, #f2f9fa);
	--sti-text: var(--wp--preset--color--contrast, #1b1b1f);
	--sti-font: var(--wp--preset--font-family--manrope, Manrope, sans-serif);

	background: var(--sti-bg);
	padding: var(--wp--preset--spacing--40, 2rem);
	border-radius: 4px;
	font-family: var(--sti-font);
	color: var(--sti-text);
}

.sti-form-wrapper { position: relative; }

/* ── Ayuda flotante (coach) — a la izquierda del paso activo, fuera del formulario ── */
.sti-coach {
	position: fixed;
	z-index: 1000;
	width: min(280px, calc(100vw - 2rem));
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease, top 0.35s ease, left 0.35s ease;
}

.sti-coach.is-hidden {
	display: none;
}

.sti-coach.is-visible {
	opacity: 1;
	pointer-events: auto;
}

.sti-coach.is-moving {
	transition: opacity 0.2s ease, top 0.55s ease, left 0.35s ease;
}

.sti-coach__panel {
	background: #fff;
	border: 1px solid var(--sti-border);
	border-radius: 12px;
	padding: 0.85rem 0.95rem 0.75rem;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
	position: relative;
}

.sti-coach__panel::before {
	content: '';
	position: absolute;
	top: 1.1rem;
	right: -7px;
	left: auto;
	width: 14px;
	height: 14px;
	background: #fff;
	border-right: 1px solid var(--sti-border);
	border-bottom: 1px solid var(--sti-border);
	transform: rotate(-45deg);
}

.sti-coach.is-below .sti-coach__panel::before {
	top: -7px;
	right: auto;
	left: 1.25rem;
	border-right: none;
	border-bottom: none;
	border-left: 1px solid var(--sti-border);
	border-top: 1px solid var(--sti-border);
	transform: rotate(45deg);
}

.sti-coach.is-right .sti-coach__panel::before {
	right: auto;
	left: -7px;
	border-right: none;
	border-bottom: none;
	border-left: 1px solid var(--sti-border);
	border-top: 1px solid var(--sti-border);
	transform: rotate(45deg);
}

.sti-coach__text {
	margin: 0 0 0.65rem;
	font-size: 0.92rem;
	line-height: 1.45;
	color: #333;
}

.sti-coach__actions {
	display: flex;
	justify-content: flex-end;
}

.sti-coach__dismiss {
	border: none;
	background: transparent;
	color: #888;
	font-size: 0.82rem;
	font-family: inherit;
	cursor: pointer;
	padding: 0.2rem 0;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.sti-coach__dismiss:hover { color: var(--sti-text); }

.sti-coach-relaunch {
	position: absolute;
	right: 1rem;
	bottom: 1rem;
	z-index: 5;
	border: 2px solid var(--sti-orange);
	background: #fff;
	color: var(--sti-orange);
	border-radius: 9999px;
	padding: 0.45rem 0.9rem;
	font-size: 0.82rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.sti-coach-relaunch:hover {
	background: var(--sti-orange);
	color: #fff;
}

.sti-coach-target {
	animation: sti-coach-pulse 1.6s ease-in-out 2;
	border-radius: 8px;
}

@keyframes sti-coach-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(255, 136, 0, 0); }
	50% { box-shadow: 0 0 0 4px rgba(255, 136, 0, 0.35); }
}

.sti-form { max-width: 960px; }

.sti-field { margin-bottom: 1.25rem; }

.sti-field label,
.sti-field legend {
	display: block;
	font-weight: 600;
	margin-bottom: 0.4rem;
	font-size: 0.95rem;
}

.sti-required { color: var(--sti-orange); }

.sti-field-hint {
	margin: 0 0 0.4rem;
	font-size: 0.85rem;
	font-weight: 400;
	color: var(--sti-border);
}

.sti-form input[type="text"],
.sti-form input[type="email"],
.sti-form input[type="tel"],
.sti-form select,
.sti-form textarea {
	width: 100%;
	color: var(--sti-text);
	padding: 0.75em;
	border: 1px solid var(--sti-border);
	border-radius: 2px;
	font-family: var(--sti-font);
	font-size: 1rem;
	background: #fff;
	box-sizing: border-box;
}

.sti-form fieldset { border: none; padding: 0; margin: 0 0 1.25rem; }

.sti-radio, .sti-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-weight: 400;
	margin-bottom: 0.5rem;
	cursor: pointer;
}

.sti-radio input, .sti-checkbox input {
	margin-top: 0.2rem;
	width: auto;
	flex-shrink: 0;
}

/* ── Bloque calendario ── */
#bloque-disponibilidad {
	background: #fff;
	border: 1px solid var(--sti-border);
	border-radius: 8px;
	padding: 1.25rem;
	margin-top: 1.5rem;
	margin-bottom: 1.5rem;
	overflow: visible;
	width: 100%;
	box-sizing: border-box;
}

#bloque-disponibilidad:not(.is-open) {
	display: none !important;
}

#bloque-disponibilidad.is-open {
	display: block !important;
}

.sti-cal-label {
	margin: 0 0 0.5rem;
	font-size: 0.95rem;
}

.sti-cal-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem 1rem;
	margin: 0 0 0.85rem;
	font-size: 0.78rem;
	color: #666;
}

.sti-cal-legend__item {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.sti-cal-legend__swatch {
	display: inline-block;
	width: 0.85rem;
	height: 0.85rem;
	border-radius: 3px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	font-style: normal;
}

.sti-cal-legend__swatch--available {
	background: #d4edda;
	border-color: #2e9e5b;
}

.sti-cal-legend__swatch--low {
	background: #ffe8cc;
	border-color: var(--sti-orange, #ff8800);
}

.sti-cal-legend__swatch--full {
	background: #f8d7da;
	border-color: #c0392b;
}

.sti-cal-legend__swatch--empty {
	background: #f5f5f7;
}

.sti-cal-legend__swatch--picked {
	background: var(--sti-green);
}

/* Filtros jornada */
.filtros-jornada {
	margin-bottom: 15px;
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.btn-filtro {
	padding: 0.5rem 1.25rem;
	border-radius: 9999px;
	border: 2px solid var(--sti-border);
	background: #fff;
	font-weight: 600;
	font-size: 0.9rem;
	font-family: var(--sti-font);
	cursor: pointer;
	color: var(--sti-text);
	transition: all 0.15s ease;
}

.btn-filtro.active,
.btn-filtro:hover {
	background: var(--sti-orange);
	border-color: var(--sti-orange);
	color: #fff;
}

/* ── Tabla horarios desktop ── */
.tabla-horarios-desktop { display: block; overflow-x: auto; }
.tabla-horarios-mobile  { display: none; }

.tabla-horarios {
	width: 100%;
	border-collapse: collapse;
	text-align: center;
	min-width: 600px;
}

.tabla-horarios thead tr {
	background-color: #f2f2f2;
}

.tabla-horarios th,
.tabla-horarios td {
	padding: 10px;
	border: 1px solid #ddd;
}

.celda-hora-label {
	font-weight: bold;
	text-align: right;
	white-space: nowrap;
	background: #fafafa;
}

/* Celdas vacías (sugerir) */
.celda-hora.vacia {
	background-color: #f5f5f7;
	color: #888;
	cursor: pointer;
	font-style: normal;
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1;
	transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
	user-select: none;
}

.celda-hora.vacia:hover,
.celda-hora.vacia:focus-visible {
	background-color: #ebebef;
	color: var(--sti-text);
	box-shadow: inset 0 0 0 2px var(--sti-green);
	outline: none;
}

/* Propuesta seleccionada → verde */
.celda-hora.vacia.seleccionada {
	background-color: var(--sti-green) !important;
	color: #fff !important;
	font-size: 1.15rem;
	font-weight: 700;
}

/* Grupo con plazas → verde */
.celda-hora.grupo-disponible {
	background-color: #d4edda;
	color: #155724;
	cursor: pointer;
	font-size: 12px;
	font-weight: bold;
	line-height: 1.4;
	transition: background 0.15s ease;
	user-select: none;
}

.celda-hora.grupo-disponible:hover {
	background-color: #c3e6cb;
}

/* Pocas plazas → naranja */
.celda-hora.grupo-pocas {
	background-color: #ffe8cc;
	color: #8a4b00;
	cursor: pointer;
	font-size: 12px;
	font-weight: bold;
	line-height: 1.4;
	transition: background 0.15s ease;
	user-select: none;
}

.celda-hora.grupo-pocas:hover {
	background-color: #ffd9a8;
}

/* Grupo completo → rojo, seleccionable para solicitar apertura paralela */
.celda-hora.grupo-lleno {
	background-color: #f8d7da;
	color: #842029;
	cursor: pointer;
	font-size: 12px;
	font-weight: bold;
	line-height: 1.4;
	position: relative;
	transition: background 0.15s ease, opacity 0.15s ease;
	user-select: none;
}

.celda-hora.grupo-lleno:hover {
	background-color: #f1c2c6;
}

/* Reserva seleccionada → verde oscuro */
.celda-hora.grupo-disponible.seleccionada-grupo,
.celda-hora.grupo-pocas.seleccionada-grupo {
	background-color: var(--sti-green-dark) !important;
	color: #fff !important;
	opacity: 1;
	box-shadow: inset 0 0 0 3px #fff;
}

.celda-hora.grupo-lleno.seleccionada-grupo {
	background-color: var(--sti-green) !important;
	color: #fff !important;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1;
	opacity: 1;
	box-shadow: inset 0 0 0 3px #fff;
}

/* ── Móvil: pestañas + paneles por día ── */
.tabla-horarios-mobile {
	width: 100%;
	overflow: visible;
}

.sti-day-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-bottom: 1rem;
}

.sti-day-tab {
	padding: 0.45rem 0.9rem;
	border-radius: 9999px;
	border: 2px solid var(--sti-border);
	background: #fff;
	font-weight: 600;
	font-size: 0.85rem;
	cursor: pointer;
	font-family: var(--sti-font);
}

.sti-day-tab.is-active {
	background: var(--sti-orange);
	border-color: var(--sti-orange);
	color: #fff;
}

.sti-mobile-day-panel {
	display: none;
}

.sti-mobile-day-panel.is-active {
	display: block;
}

.sti-mobile-slot {
	margin-bottom: 0.85rem;
}

.sti-mobile-slot:last-child {
	margin-bottom: 0;
}

.sti-mobile-slot-label {
	font-size: 0.9rem;
	font-weight: 700;
	margin-bottom: 0.4rem;
	color: var(--sti-text);
}

.tabla-horarios-mobile .celda-hora {
	width: 100%;
	min-height: 3.25rem;
	padding: 14px 12px;
	border-radius: 6px;
	border: 1px solid #ddd;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
}

/* Botón enviar */
.sti-actions { margin-top: 1.5rem; }

.sti-submit {
	background: var(--sti-orange);
	border: none;
	border-radius: 9999px;
	color: #fff;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 500;
	padding: 1rem 2.25rem;
	text-transform: uppercase;
	cursor: pointer;
}

.sti-submit:hover:not(:disabled) { background: var(--sti-orange-dark); }
.sti-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.sti-message {
	margin-top: 1rem;
	padding: 1rem 1.25rem;
	border-radius: 10px;
	background: #fff;
}

.sti-message.is-success { border-left: 4px solid #2e9e5b; }
.sti-message.is-error   { border-left: 4px solid #c0392b; }

.sti-success {
	max-width: 40rem;
	margin: 0 auto;
	padding: 1.75rem 1.5rem;
	border-radius: 12px;
	background: #fff;
	border-left: 4px solid #2e9e5b;
}

.sti-success__title {
	margin: 0 0 0.85rem;
	font-size: 1.45rem;
	line-height: 1.25;
}

.sti-success p {
	margin: 0 0 0.75rem;
	line-height: 1.5;
}

.sti-success p:last-child {
	margin-bottom: 0;
}

.sti-success__note {
	color: #5c5c5c;
	font-size: 0.95rem;
}

.sti-honeypot { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.sti-dialog {
	border: none; border-radius: 12px; padding: 1.5rem;
	max-width: 420px; width: 90%;
	box-shadow: 0 8px 32px rgba(0,0,0,.18);
	font-family: var(--sti-font);
}

.sti-dialog::backdrop { background: rgba(0,0,0,.45); }

.sti-dialog-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1rem; }

.sti-dialog-cancel, .sti-dialog-confirm {
	padding: 0.6rem 1.25rem; border-radius: 9999px;
	font-family: inherit; font-weight: 600; cursor: pointer;
	border: 2px solid var(--sti-border); background: #fff;
}

.sti-dialog-confirm {
	background: var(--sti-orange); border-color: var(--sti-orange); color: #fff;
}

@media (max-width: 900px) {
	.tabla-horarios-desktop { display: none !important; }
	.tabla-horarios-mobile  { display: block !important; visibility: visible !important; }
	.sti-form-wrapper { padding: 1.25rem; }
	#bloque-disponibilidad { padding: 1rem; }
	.sti-day-tab {
		flex: 1 1 calc(50% - 0.35rem);
		min-width: 0;
		text-align: center;
	}
}
