/* ==========================================================================
   Plataforma EducaDrones — sistema de diseño base
   Marca: azul #035AA6 → cian #16CAF2, negro #0A0A0A. Tipografías Outfit
   (texto) y Space Grotesk (rótulos y cifras), alojadas en el plugin.
   ========================================================================== */

@font-face {
	font-family: "Outfit";
	src: url("../fonts/outfit-latin-wght-normal.woff2") format("woff2-variations");
	font-weight: 100 900;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Outfit";
	src: url("../fonts/outfit-latin-ext-wght-normal.woff2") format("woff2-variations");
	font-weight: 100 900;
	font-display: swap;
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Space Grotesk";
	src: url("../fonts/space-grotesk-latin-wght-normal.woff2") format("woff2-variations");
	font-weight: 300 700;
	font-display: swap;
}

:root {
	--azul: #035AA6;
	--azul-700: #02467F;
	--azul-100: #D6E8F7;
	--azul-50: #EEF5FC;
	--cian: #16CAF2;
	--cian-50: #E7F9FE;
	--negro: #0A0A0A;
	--tinta: #10161F;
	--texto-suave: #5A6474;
	--texto-tenue: #8B94A3;
	--borde: #E2E7EE;
	--borde-fuerte: #CBD3DE;
	--fondo: #F3F6F9;
	--blanco: #FFFFFF;
	--verde: #0E9F5A;
	--verde-50: #E7F7EF;
	--ambar: #C77A00;
	--ambar-50: #FFF5E0;
	--rojo: #D12A4B;
	--rojo-50: #FDECEF;

	--degradado: linear-gradient(135deg, #035AA6 0%, #16CAF2 100%);
	--radio: 16px;
	--radio-sm: 10px;
	--sombra: 0 1px 2px rgba(16, 22, 31, .06), 0 4px 16px rgba(16, 22, 31, .06);
	--sombra-alta: 0 12px 40px rgba(3, 50, 92, .18);
	--fuente: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--fuente-tec: "Space Grotesk", "Outfit", ui-sans-serif, system-ui, sans-serif;
	--foco: 0 0 0 3px rgba(22, 202, 242, .45);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.edr {
	margin: 0;
	min-height: 100vh;
	background: var(--fondo);
	color: var(--tinta);
	font-family: var(--fuente);
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
/* Íconos: por defecto del tamaño del texto que los rodea; cada componente lo ajusta. */
svg[aria-hidden="true"] { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
a { color: var(--azul); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.15; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
:focus-visible { outline: none; box-shadow: var(--foco); border-radius: 6px; }
[hidden] { display: none !important; }

.texto-suave { color: var(--texto-suave); }
.texto-tenue { color: var(--texto-tenue); font-size: .875rem; }
.cifra { font-family: var(--fuente-tec); font-variant-numeric: tabular-nums; }
.sobretitulo {
	font-family: var(--fuente-tec);
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--azul);
}
.visualmente-oculto {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Logotipo provisorio ---------- */
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--azul); line-height: 1; }
.logo--img { height: 40px; width: auto; display: block; }
.logo__alas {
	width: 26px; height: 22px; flex: none;
	background: linear-gradient(var(--azul), var(--azul)) 0 0 / 100% 4px no-repeat,
	            linear-gradient(var(--azul), var(--azul)) 4px 7px / 80% 4px no-repeat,
	            linear-gradient(var(--azul), var(--azul)) 8px 14px / 60% 4px no-repeat;
	transform: skewX(-18deg);
}
.logo__texto { display: flex; flex-direction: column; font-weight: 900; font-style: italic; font-size: 1.05rem; letter-spacing: -.01em; }
.logo__chile {
	align-self: flex-end; font-family: var(--fuente-tec); font-size: .55rem; font-weight: 700; letter-spacing: .12em;
	color: #fff; background: linear-gradient(90deg, var(--azul) 0 50%, #D60043 50% 100%); padding: 2px 4px; border-radius: 2px;
}
.logo--claro { color: #fff; }
.logo--claro .logo__alas { filter: brightness(0) invert(1); }

/* ---------- Botones ---------- */
.boton {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 10px 20px;
	border: 1.5px solid transparent; border-radius: 999px;
	font-weight: 600; font-size: .95rem; line-height: 1.2;
	cursor: pointer; text-decoration: none; white-space: nowrap;
	transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
	-webkit-tap-highlight-color: transparent;
}
.boton:active:not(:disabled) { transform: translateY(1px); }
.boton:disabled, .boton[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.boton svg { width: 18px; height: 18px; flex: none; }
.boton--primario { background: var(--azul); color: #fff; }
.boton--primario:hover:not(:disabled) { background: var(--azul-700); }
.boton--degradado { background: var(--degradado); color: #fff; box-shadow: 0 6px 18px rgba(3, 90, 166, .25); }
.boton--degradado:hover:not(:disabled) { box-shadow: 0 8px 24px rgba(3, 90, 166, .35); }
.boton--oscuro { background: var(--negro); color: #fff; }
.boton--oscuro:hover:not(:disabled) { background: #222; }
.boton--secundario { background: #fff; color: var(--tinta); border-color: var(--borde-fuerte); }
.boton--secundario:hover:not(:disabled) { border-color: var(--azul); color: var(--azul); }
.boton--fantasma { background: transparent; color: var(--azul); }
.boton--fantasma:hover:not(:disabled) { background: var(--azul-50); }
.boton--peligro { background: var(--rojo); color: #fff; }
.boton--peligro:hover:not(:disabled) { background: #B11F3D; }
.boton--peligro-suave { background: #fff; color: var(--rojo); border-color: #F2C1CB; }
.boton--peligro-suave:hover:not(:disabled) { background: var(--rojo-50); }
.boton--chico { min-height: 36px; padding: 6px 14px; font-size: .875rem; }
.boton--bloque { width: 100%; }
.boton-icono {
	display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
	border: 0; border-radius: 999px; background: transparent; color: var(--texto-suave); cursor: pointer;
}
.boton-icono:hover { background: var(--fondo); color: var(--tinta); }
.boton-icono svg { width: 20px; height: 20px; }
.enlace { color: var(--azul); font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.enlace:hover { text-decoration: underline; }

/* ---------- Formularios ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.campo > label, .etiqueta { font-weight: 600; font-size: .9rem; }
.campo input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.campo select, .campo textarea, .entrada {
	width: 100%; min-height: 46px; padding: 10px 14px;
	background: #fff; border: 1.5px solid var(--borde-fuerte); border-radius: var(--radio-sm);
	transition: border-color .15s, box-shadow .15s;
}
.campo textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.campo input:focus, .campo select:focus, .campo textarea:focus, .entrada:focus { outline: none; border-color: var(--azul); box-shadow: var(--foco); }
.campo--error input, .campo--error select, .campo--error textarea { border-color: var(--rojo); }
.campo__ayuda { color: var(--texto-suave); font-size: .82rem; min-height: 1em; }
.campo__error { color: var(--rojo); font-size: .82rem; font-weight: 500; }
.campo__con-boton { position: relative; }
.campo__con-boton input { padding-right: 52px !important; }
.campo__con-boton .boton-icono { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.campo--ok input { border-color: var(--verde); }
.fila-campos { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.casilla { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .92rem; margin: 4px 0 18px; }
.casilla input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--azul); flex: none; }
.requerido::after { content: " *"; color: var(--rojo); }

/* ---------- Tarjetas y estructura ---------- */
.tarjeta { background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); padding: 24px; }
.tarjeta--plana { box-shadow: none; }
.tarjeta__cabecera { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.tarjeta__cabecera h2, .tarjeta__cabecera h3 { margin: 0; }
.separador { height: 1px; background: var(--borde); margin: 20px 0; border: 0; }
.pila > * + * { margin-top: 16px; }
.fila { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fila--entre { justify-content: space-between; }
.cuadricula { display: grid; gap: 16px; }

/* ---------- Avisos ---------- */
.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radio-sm); font-size: .92rem; margin-bottom: 16px; border: 1px solid transparent; }
.aviso svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.aviso--error { background: var(--rojo-50); color: #8E1530; border-color: #F6CCD5; }
.aviso--ok { background: var(--verde-50); color: #0A6B3D; border-color: #BFE8D2; }
.aviso--info { background: var(--azul-50); color: var(--azul-700); border-color: var(--azul-100); }
.aviso--alerta { background: var(--ambar-50); color: #7A4A00; border-color: #F5DDAA; }

/* ---------- Chips ---------- */
.chip {
	display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
	font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--fondo); color: var(--texto-suave);
}
.chip--verde { background: var(--verde-50); color: #0A7A45; }
.chip--azul { background: var(--azul-50); color: var(--azul); }
.chip--ambar { background: var(--ambar-50); color: #8A5600; }
.chip--rojo { background: var(--rojo-50); color: #B01E3C; }
.chip--oscuro { background: var(--negro); color: #fff; }
.chip svg { width: 14px; height: 14px; }
.punto { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- Barra de progreso ---------- */
.barra { height: 8px; background: var(--azul-50); border-radius: 999px; overflow: hidden; }
.barra > span { display: block; height: 100%; background: var(--degradado); border-radius: inherit; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.barra--verde > span { background: var(--verde); }

/* ---------- Tablas ---------- */
.tabla-contenedor { overflow-x: auto; border: 1px solid var(--borde); border-radius: var(--radio); background: #fff; }
.tabla { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabla th { text-align: left; font-family: var(--fuente-tec); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--texto-suave); font-weight: 600; padding: 12px 16px; background: #FAFBFD; border-bottom: 1px solid var(--borde); white-space: nowrap; }
.tabla td { padding: 12px 16px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr.clicable { cursor: pointer; }
.tabla tbody tr.clicable:hover { background: #F8FAFD; }

/* ---------- Ventana modal ---------- */
.modal-fondo {
	position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
	background: rgba(10, 18, 30, .55); backdrop-filter: blur(3px);
	animation: aparecer .15s ease-out;
}
.modal {
	width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto;
	background: #fff; border-radius: 20px; box-shadow: var(--sombra-alta);
	animation: subir .2s cubic-bezier(.2, .8, .2, 1);
}
.modal--ancho { max-width: 820px; }
.modal__cabecera { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 0; }
.modal__cabecera h2 { font-size: 1.3rem; margin: 0; }
.modal__cuerpo { padding: 18px 24px; }
.modal__pie { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 0 24px 22px; }
@media (max-width: 600px) {
	.modal-fondo { place-items: end center; padding: 0; }
	.modal { border-radius: 20px 20px 0 0; max-height: 92vh; }
	.modal__pie .boton { flex: 1; }
}

/* ---------- Avisos flotantes ---------- */
.tostadas { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.tostada {
	pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 14px;
	background: var(--negro); color: #fff; box-shadow: var(--sombra-alta); font-size: .92rem; animation: subir .2s ease-out;
}
.tostada--error { background: #8E1530; }
.tostada--ok svg { color: #5BE59A; }
.tostada svg { width: 20px; height: 20px; flex: none; }

/* ---------- Estados ---------- */
.arranque { min-height: 60vh; display: grid; place-items: center; align-content: center; gap: 14px; color: var(--texto-suave); }
.girador { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--azul-100); border-top-color: var(--azul); animation: girar .8s linear infinite; }
.girador--chico { width: 18px; height: 18px; border-width: 2px; }
/* Cargador de marca: el dron del logo flota y sus hélices pulsan. */
.carga-marca { display: inline-block; width: 64px; height: 64px; filter: drop-shadow(0 8px 14px rgba(3, 90, 166, .22)); animation: flotar 1.8s ease-in-out infinite; }
.carga-marca svg { display: block; width: 100%; height: 100%; }
.carga-marca__rotor { transform-box: fill-box; transform-origin: center; animation: rotor .35s ease-in-out infinite alternate; }
@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes rotor { from { transform: scaleX(1); } to { transform: scaleX(.55); } }
.vacio { text-align: center; padding: 40px 20px; color: var(--texto-suave); }
.vacio svg { width: 48px; height: 48px; color: var(--azul-100); margin: 0 auto 12px; }
.sin-js { margin: 40px auto; max-width: 480px; text-align: center; }
.esqueleto { background: linear-gradient(90deg, #EDF1F5 25%, #F6F8FA 50%, #EDF1F5 75%); background-size: 200% 100%; animation: brillo 1.2s infinite; border-radius: 10px; }

@keyframes girar { to { transform: rotate(360deg); } }
@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { opacity: 0; transform: translateY(12px); } }
@keyframes brillo { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
