/**
 * Capacitación FUNDAP — estilos públicos.
 * Diseño institucional, minimalista y responsive.
 */

:root {
	--fundap-primary: #0B4F9E;
	--fundap-secondary: #4FA8E0;
	--fundap-ink: #1D2733;
	--fundap-muted: #63707E;
	--fundap-line: #E3E9F0;
	--fundap-surface: #FFFFFF;
	--fundap-canvas: #F6F9FC;
	--fundap-radius: 14px;
	--fundap-radius-sm: 9px;
	--fundap-shadow: 0 1px 2px rgba(17, 38, 63, .05), 0 8px 24px rgba(17, 38, 63, .06);
	--fundap-success: #1E7F4F;
	--fundap-warning: #9A6300;
	--fundap-danger: #B3261E;
}

.fundap-shell {
	box-sizing: border-box;
	width: 100%;
	max-width: 860px;
	margin: 0 auto;
	padding: 32px 20px 64px;
	color: var(--fundap-ink);
	font-size: 16px;
	line-height: 1.55;
}

.fundap-shell *,
.fundap-shell *::before,
.fundap-shell *::after,
.fundap-course-screen *,
.fundap-course-screen *::before,
.fundap-course-screen *::after {
	box-sizing: border-box;
}

.fundap-shell--auth {
	max-width: 520px;
	padding-top: 56px;
}

/* ---------- Tarjetas ---------- */

.fundap-card {
	background: var(--fundap-surface);
	border: 1px solid var(--fundap-line);
	border-radius: var(--fundap-radius);
	box-shadow: var(--fundap-shadow);
	padding: 32px;
	margin-bottom: 24px;
}

.fundap-card--auth {
	padding: 40px 36px;
}

.fundap-card--empty {
	text-align: center;
	color: var(--fundap-muted);
}

/* ---------- Cabecera ---------- */

.fundap-topline {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
}

.fundap-logo {
	margin-bottom: 20px;
	text-align: center;
}

.fundap-topline .fundap-logo {
	margin-bottom: 0;
	text-align: left;
}

.fundap-logo__image {
	max-width: 190px;
	height: auto;
}

.fundap-logo__text {
	display: inline-block;
	font-size: 20px;
	font-weight: 700;
	letter-spacing: .04em;
	color: var(--fundap-primary);
}

.fundap-title {
	margin: 0 0 6px;
	font-size: 24px;
	line-height: 1.25;
	font-weight: 650;
	color: var(--fundap-ink);
	text-align: center;
}

.fundap-shell:not(.fundap-shell--auth) .fundap-title {
	text-align: left;
}

.fundap-subtitle {
	margin: 0 0 24px;
	color: var(--fundap-muted);
	font-size: 15px;
	text-align: center;
}

.fundap-shell:not(.fundap-shell--auth) .fundap-subtitle {
	text-align: left;
}

.fundap-intro {
	margin: 0 0 20px;
	padding: 14px 16px;
	background: var(--fundap-canvas);
	border-radius: var(--fundap-radius-sm);
	font-size: 14px;
	color: var(--fundap-muted);
}

.fundap-section-title {
	margin: 0 0 12px;
	font-size: 18px;
	font-weight: 650;
}

.fundap-greeting {
	margin: 0 0 16px;
	font-size: 22px;
	font-weight: 650;
}

.fundap-profile-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 28px;
	font-size: 14px;
	color: var(--fundap-muted);
}

.fundap-profile-meta strong {
	color: var(--fundap-ink);
	font-weight: 600;
}

/* ---------- Pestañas ---------- */

.fundap-tabs {
	display: flex;
	gap: 6px;
	padding: 5px;
	margin-bottom: 26px;
	background: var(--fundap-canvas);
	border-radius: var(--fundap-radius-sm);
}

.fundap-tab {
	flex: 1;
	padding: 10px 12px;
	border-radius: 7px;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	color: var(--fundap-muted);
	text-decoration: none;
	transition: background .15s ease, color .15s ease;
}

.fundap-tab:hover {
	color: var(--fundap-primary);
}

.fundap-tab.is-active {
	background: var(--fundap-surface);
	color: var(--fundap-primary);
	box-shadow: 0 1px 2px rgba(17, 38, 63, .08);
}

/* ---------- Formularios ---------- */

.fundap-form {
	margin: 0;
}

.fundap-field {
	margin-bottom: 18px;
}

.fundap-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--fundap-ink);
}

.fundap-field input[type="text"],
.fundap-field input[type="email"],
.fundap-field input[type="password"],
.fundap-field select {
	width: 100%;
	padding: 11px 13px;
	font-size: 15px;
	font-family: inherit;
	color: var(--fundap-ink);
	background: var(--fundap-surface);
	border: 1px solid var(--fundap-line);
	border-radius: var(--fundap-radius-sm);
	transition: border-color .15s ease, box-shadow .15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.fundap-field select {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2363707E' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 13px center;
	padding-right: 36px;
}

.fundap-field input:focus,
.fundap-field select:focus {
	outline: none;
	border-color: var(--fundap-secondary);
	box-shadow: 0 0 0 3px var(--fundap-secondary-soft, rgba(79, 168, 224, .18));
}

.fundap-required {
	color: var(--fundap-danger);
}

.fundap-hint {
	display: block;
	margin-top: 6px;
	font-size: 12.5px;
	color: var(--fundap-muted);
}

.fundap-help {
	font-size: 14px;
	color: var(--fundap-muted);
}

.fundap-legal {
	margin: 16px 0 0;
	font-size: 12.5px;
	color: var(--fundap-muted);
}

.fundap-grid {
	display: grid;
	gap: 0 18px;
}

.fundap-grid--2 {
	grid-template-columns: 1fr 1fr;
}

.fundap-checkbox {
	display: flex;
	align-items: center;
	gap: 9px;
	margin-bottom: 20px;
	font-size: 14px;
	color: var(--fundap-muted);
	cursor: pointer;
}

.fundap-honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.fundap-links {
	margin: 18px 0 0;
	text-align: center;
	font-size: 14px;
}

.fundap-links a {
	color: var(--fundap-primary);
	text-decoration: none;
}

.fundap-links a:hover {
	text-decoration: underline;
}

/* ---------- Acceso por código ---------- */

.fundap-input-code {
	font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
	font-size: 22px !important;
	font-weight: 600;
	letter-spacing: .12em;
	text-align: center;
	text-transform: uppercase;
	padding: 14px 13px !important;
}

.fundap-identity {
	margin: 0 0 26px;
	padding: 4px 0;
	border: 1px solid var(--fundap-line);
	border-radius: var(--fundap-radius-sm);
	background: var(--fundap-canvas);
}

.fundap-identity__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding: 11px 16px;
	border-bottom: 1px solid rgba(227, 233, 240, .8);
}

.fundap-identity__row:last-child {
	border-bottom: 0;
}

.fundap-identity__label {
	margin: 0;
	font-size: 12px;
	font-weight: 650;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--fundap-muted);
	white-space: nowrap;
}

.fundap-identity__value {
	margin: 0;
	font-size: 15.5px;
	font-weight: 600;
	text-align: right;
	word-break: break-word;
}

.fundap-link-quiet {
	color: var(--fundap-muted) !important;
	font-size: 13.5px;
}

.fundap-link-quiet:hover {
	color: var(--fundap-primary) !important;
}

/* ---------- Botones ---------- */

.fundap-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 22px;
	font-family: inherit;
	font-size: 14.5px;
	font-weight: 650;
	letter-spacing: .01em;
	line-height: 1.2;
	border: 1px solid transparent;
	border-radius: var(--fundap-radius-sm);
	cursor: pointer;
	text-decoration: none;
	transition: background .15s ease, border-color .15s ease, color .15s ease, transform .08s ease;
}

.fundap-button:active {
	transform: translateY(1px);
}

.fundap-button:focus-visible {
	outline: 3px solid var(--fundap-secondary);
	outline-offset: 2px;
}

.fundap-button--primary {
	background: var(--fundap-primary);
	color: #fff;
}

.fundap-button--primary:hover {
	background: #09447f;
	color: #fff;
}

.fundap-button--success {
	background: var(--fundap-success);
	color: #fff;
}

.fundap-button--success:hover {
	background: #17663f;
	color: #fff;
}

.fundap-button--ghost {
	background: transparent;
	border-color: var(--fundap-line);
	color: var(--fundap-ink);
}

.fundap-button--ghost:hover {
	border-color: var(--fundap-secondary);
	color: var(--fundap-primary);
}

.fundap-button--block {
	width: 100%;
}

.fundap-button--small {
	padding: 8px 15px;
	font-size: 13px;
}

.fundap-button[disabled] {
	opacity: .55;
	cursor: not-allowed;
}

/* ---------- Avisos ---------- */

.fundap-notices {
	margin-bottom: 20px;
}

.fundap-notice {
	padding: 12px 15px;
	margin-bottom: 10px;
	font-size: 14px;
	border-radius: var(--fundap-radius-sm);
	border-left: 3px solid var(--fundap-secondary);
	background: var(--fundap-canvas);
}

.fundap-notice--error {
	border-left-color: var(--fundap-danger);
	background: #FDF3F2;
	color: #7A1A15;
}

.fundap-notice--success {
	border-left-color: var(--fundap-success);
	background: #F1F8F4;
	color: #14563A;
}

.fundap-notice--warning {
	border-left-color: var(--fundap-warning);
	background: #FDF7EC;
	color: #6B4600;
}

/* ---------- Tarjeta de curso ---------- */

.fundap-course-card__image {
	margin: -32px -32px 24px;
	overflow: hidden;
	border-radius: var(--fundap-radius) var(--fundap-radius) 0 0;
}

.fundap-course-card__image img {
	display: block;
	width: 100%;
	height: auto;
}

.fundap-course-title {
	margin: 0 0 10px;
	font-size: 20px;
	font-weight: 650;
	line-height: 1.3;
}

.fundap-course-description {
	margin-bottom: 20px;
	color: var(--fundap-muted);
	font-size: 15px;
}

.fundap-course-description p {
	margin: 0 0 10px;
}

.fundap-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 14px 40px;
	margin-bottom: 20px;
}

.fundap-stat {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.fundap-stat__label {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--fundap-muted);
}

.fundap-stat__value {
	font-size: 22px;
	font-weight: 650;
	color: var(--fundap-ink);
}

.fundap-mono {
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum";
}

.fundap-badge {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	padding: 5px 11px;
	font-size: 13px;
	font-weight: 600;
	border-radius: 999px;
	background: var(--fundap-canvas);
	color: var(--fundap-muted);
}

.fundap-badge--in_progress {
	background: rgba(79, 168, 224, .16);
	color: #0B4F9E;
}

.fundap-badge--completed {
	background: rgba(30, 127, 79, .13);
	color: var(--fundap-success);
}

.fundap-progress {
	height: 7px;
	margin-bottom: 22px;
	background: var(--fundap-canvas);
	border-radius: 999px;
	overflow: hidden;
}

.fundap-progress__bar {
	height: 100%;
	background: var(--fundap-secondary);
	border-radius: 999px;
	transition: width .4s ease;
}

/* ---------- Pantalla del curso ---------- */

body.fundap-fullscreen {
	margin: 0;
	padding: 0;
	background: var(--fundap-canvas);
}

/*
 * La pantalla se ancla al viewport en lugar de ocupar "100vh" dentro del flujo
 * del tema: cualquier contenedor del tema con padding, margen o scroll propio
 * empujaba la barra fuera de la vista en pantallas anchas. Fijada, la barra
 * está presente en todo momento y a cualquier ancho.
 */
body.fundap-training-course-page .fundap-course-screen {
	position: fixed;
	top: var(--wp-admin--admin-bar--height, 0px);
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--fundap-canvas);
	color: var(--fundap-ink);
	font-size: 16px;
	z-index: 99990;
}

/* Sin la barra fija, el scroll del tema no debe existir detrás de la pantalla. */
body.fundap-training-course-page,
html:has(body.fundap-training-course-page) {
	overflow: hidden;
}

.fundap-course-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
	flex: 0 0 auto;
	padding: 12px 22px;
	background: var(--fundap-surface);
	border-bottom: 1px solid var(--fundap-line);
	box-shadow: 0 1px 3px rgba(17, 38, 63, .05);
	z-index: 5;
}

.fundap-course-card__docs {
	margin: 14px 0 0;
	text-align: center;
}

.fundap-course-bar__identity {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.fundap-course-bar__greeting {
	font-size: 15px;
	font-weight: 650;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fundap-course-bar__course {
	font-size: 12.5px;
	color: var(--fundap-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 42vw;
}

.fundap-course-bar__timer {
	display: flex;
	align-items: baseline;
	gap: 10px;
}

.fundap-course-bar__timer-label {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--fundap-muted);
}

.fundap-course-bar__timer-value {
	font-size: 24px;
	font-weight: 650;
	color: var(--fundap-primary);
}

.fundap-course-bar__state {
	font-size: 12.5px;
	color: var(--fundap-muted);
}

.fundap-course-bar__state--paused {
	color: var(--fundap-warning);
	font-weight: 600;
}

.fundap-course-bar__state--offline {
	color: var(--fundap-danger);
	font-weight: 600;
}

.fundap-course-bar__actions {
	display: flex;
	gap: 8px;
}

.fundap-course-stage {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	background: #fff;
}

.fundap-course-frame {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ---------- Superposición ---------- */

.fundap-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(246, 249, 252, .96);
	backdrop-filter: blur(2px);
	z-index: 10;
}

.fundap-overlay[hidden] {
	display: none;
}

.fundap-overlay__card {
	width: 100%;
	max-width: 440px;
	padding: 34px 32px;
	text-align: center;
	background: var(--fundap-surface);
	border: 1px solid var(--fundap-line);
	border-radius: var(--fundap-radius);
	box-shadow: var(--fundap-shadow);
}

.fundap-overlay__title {
	margin: 0 0 10px;
	font-size: 21px;
	font-weight: 650;
}

.fundap-overlay__text {
	margin: 0 0 18px;
	color: var(--fundap-muted);
	font-size: 15px;
}

.fundap-overlay__time {
	margin: 0 0 22px;
	font-size: 34px;
	font-weight: 650;
	color: var(--fundap-primary);
}

.fundap-overlay__time[hidden] {
	display: none;
}

.fundap-overlay__notice {
	margin: 0 0 22px;
	padding: 12px 14px;
	font-size: 13.5px;
	line-height: 1.5;
	text-align: left;
	color: #6a4a05;
	background: #fff8e6;
	border: 1px solid #f2d492;
	border-radius: 10px;
}

.fundap-overlay__notice[hidden] {
	display: none;
}

/* Indicador mientras el paquete Rise carga dentro del iframe. */
.fundap-course-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	font-size: 14px;
	color: var(--fundap-muted);
	background: #fff;
	z-index: 8;
}

.fundap-course-loading[hidden] {
	display: none;
}

.fundap-course-loading::before {
	content: "";
	width: 22px;
	height: 22px;
	border: 3px solid var(--fundap-line);
	border-top-color: var(--fundap-primary);
	border-radius: 50%;
	animation: fundap-spin 900ms linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
	.fundap-course-loading::before {
		animation: none;
	}
}

.fundap-overlay__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.fundap-overlay__actions .fundap-button[hidden] {
	display: none;
}

.fundap-noscript {
	padding: 16px 22px;
	background: #FDF3F2;
	color: #7A1A15;
	font-size: 14px;
	text-align: center;
}

.fundap-course-exit-link[hidden] {
	display: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 782px) {
	.fundap-shell {
		padding: 20px 16px 48px;
	}

	.fundap-shell--auth {
		padding-top: 28px;
	}

	.fundap-card {
		padding: 24px 20px;
	}

	.fundap-card--auth {
		padding: 28px 22px;
	}

	.fundap-course-card__image {
		margin: -24px -20px 20px;
	}

	.fundap-grid--2 {
		grid-template-columns: 1fr;
	}

	.fundap-course-bar {
		gap: 10px 14px;
		padding: 10px 14px;
	}

	.fundap-course-bar__identity {
		order: 1;
		flex: 1 1 100%;
	}

	.fundap-course-bar__course {
		max-width: none;
	}

	.fundap-course-bar__timer {
		order: 2;
		flex: 1 1 auto;
	}

	.fundap-course-bar__timer-value {
		font-size: 20px;
	}

	.fundap-course-bar__actions {
		order: 3;
		margin-left: auto;
	}

	.fundap-greeting {
		font-size: 19px;
	}

	.fundap-stat__value {
		font-size: 19px;
	}
}

@media (max-width: 420px) {
	.fundap-course-bar__timer-label {
		display: none;
	}

	.fundap-button--small {
		padding: 7px 11px;
		font-size: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fundap-button,
	.fundap-progress__bar,
	.fundap-tab {
		transition: none;
	}
}
