/* ============================================================
   estilos.css — Sistema de diseño institucional
   Plataforma de Exalumnos - Colegio Nacional San Juan
   ============================================================ */

:root {
    --rojo: #C24B3B;
    --rojo-oscuro: #9A3A2C;
    --dorado: #E8B923;
    --dorado-suave: #F5E3B0;
    --verde: #1F6B3A;
    --azul: #241F1A;
    --azul-claro: #A3781A;
    --crema: #F0EAD9;
    --texto: #221E19;
    --texto-suave: #6b6459;
    --borde: #E2D9C0;
    --sombra: 0 2px 10px rgba(20, 20, 20, 0.06);
    --sombra-fuerte: 0 4px 18px rgba(20, 20, 20, 0.12);
    --radio: 4px;
    --oscuro-footer: #241F1A;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--crema);
    color: var(--texto);
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--azul); }

/* ------------------------------------------------------------
   Encabezado institucional (escudo siempre visible)
   ------------------------------------------------------------ */
.cabecera-franja {
    height: 4px;
    background: linear-gradient(90deg, var(--rojo) 0 25%, var(--dorado) 25% 50%, var(--verde) 50% 75%, var(--azul) 75% 100%);
    flex-shrink: 0;
}

.cabecera-app {
    background: #fff;
    border-bottom: 1px solid var(--borde);
    box-shadow: var(--sombra);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.cabecera-contenido {
    max-width: 960px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.cabecera-marca {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.cabecera-logo {
    width: 44px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.cabecera-textos { line-height: 1.25; }
.cabecera-titulo { display: block; font-weight: 800; color: var(--texto); font-size: 16px; }
.cabecera-titulo-rojo { color: var(--rojo); }
.cabecera-subtitulo { display: block; font-size: 11.5px; color: var(--texto-suave); line-height: 1.35; margin-top: 2px; }

.enlace-sitio-principal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--texto-suave);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid var(--borde);
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.enlace-sitio-principal svg { width: 13px; height: 13px; flex-shrink: 0; }
.enlace-sitio-principal:hover { background: #f5efe0; color: var(--azul); border-color: #e6dcc0; }

@media (max-width: 560px) {
    .enlace-sitio-principal span { display: none; }
    .enlace-sitio-principal { padding: 8px; }
}

.cabecera-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.nav-grupo {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #f1efe6;
    border: 1px solid #e9e5d5;
    border-radius: 4px;
    padding: 4px;
}

.nav-grupo a {
    font-size: 14px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 3px;
    text-decoration: none;
    color: var(--texto-suave);
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nav-grupo a svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-grupo a:hover { color: var(--azul); }
.nav-grupo a.activo {
    background: #fff;
    color: var(--rojo);
    box-shadow: 0 2px 6px rgba(20,20,20,0.12);
}

.btn-salir {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--rojo-oscuro);
    background: #fff;
    border: 1.5px solid #f0d4d4;
    transition: background 0.18s ease, border-color 0.18s ease;
    white-space: nowrap;
}
.btn-salir svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-salir:hover { background: #fbeaea; border-color: #e9b8b8; }

.badge-contador {
    background: var(--rojo);
    color: #fff;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 1px 6px;
    line-height: 1.5;
}
.nav-grupo a.activo .badge-contador { background: var(--rojo); color: #fff; }

@media (max-width: 640px) {
    .nav-grupo a span:not(.badge-contador) { display: none; }
    .btn-salir .texto-salir { display: none; }
    .nav-grupo a { padding: 9px 11px; }
    .btn-salir { padding: 9px 11px; }
}

/* ------------------------------------------------------------
   Contenedor principal (ancho responsivo)
   ------------------------------------------------------------ */
.contenedor {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px 40px;
    flex: 1;
}
@media (min-width: 700px) {
    .contenedor { max-width: 680px; padding-top: 28px; }
}
@media (min-width: 1024px) {
    .contenedor { max-width: 920px; padding-top: 34px; }
}

.contenedor-angosto { max-width: 440px; }
@media (min-width: 700px) {
    .contenedor-angosto { max-width: 460px; }
}

/* ------------------------------------------------------------
   Encabezados de página
   ------------------------------------------------------------ */
.titulo-pagina {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 10px;
    flex-wrap: wrap;
}
.titulo-pagina h1 { font-size: 22px; margin: 0; color: var(--azul); }
.titulo-pagina .enlace-volver { font-size: 14.5px; color: var(--texto-suave); text-decoration: none; }
.titulo-pagina .enlace-volver:hover { color: var(--rojo); }

/* ------------------------------------------------------------
   Tarjetas / paneles
   ------------------------------------------------------------ */
.panel {
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 18px;
    margin-bottom: 16px;
}

.rejilla-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
@media (min-width: 700px) {
    .rejilla-2 { grid-template-columns: 1fr 1fr; }
}

/* ------------------------------------------------------------
   Formularios
   ------------------------------------------------------------ */
fieldset {
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    margin-bottom: 18px;
    padding: 16px;
    background: #fff;
    box-shadow: var(--sombra);
}
legend { font-weight: 700; font-size: 15px; padding: 0 8px; color: var(--azul); }

label { display: block; margin-top: 14px; font-size: 14.5px; color: #3a3a3a; font-weight: 600; }

input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=file], select, textarea {
    width: 100%;
    padding: 13px 12px;
    margin-top: 6px;
    border: 1px solid #d7d2c2;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    background: #fff;
    color: var(--texto);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--azul-claro);
    box-shadow: 0 0 0 3px rgba(163, 120, 26, 0.15);
}
input[disabled] { background: #f1f1ee; color: #888; }

.fila-dinamica { display: flex; gap: 8px; margin-top: 6px; }
.fila-dinamica input { flex: 1; }

/* ------------------------------------------------------------
   Acordeón (secciones de formulario colapsables)
   ------------------------------------------------------------ */
.acordeon {
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    background: #fff;
    box-shadow: var(--sombra);
    margin-bottom: 24px;
    overflow: hidden;
}
.acordeon > summary {
    list-style: none;
    cursor: pointer;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 15.5px;
    color: var(--azul);
    background: #fff;
    transition: background 0.15s ease;
}
.acordeon > summary::-webkit-details-marker { display: none; }
.acordeon > summary:hover { background: #f7f6f1; }
.acordeon[open] > summary { border-bottom: 1px solid var(--borde); background: var(--crema); }

.acordeon-numero {
    display: inline-flex; align-items: center; justify-content: center;
    width: 27px; height: 27px; border-radius: 50%;
    background: var(--dorado-suave); color: var(--rojo-oscuro);
    font-size: 13.5px; font-weight: 800; margin-right: 10px; flex-shrink: 0;
}
.acordeon-titulo { display: flex; align-items: center; flex: 1; }
.acordeon-chevron { transition: transform 0.2s ease; color: var(--texto-suave); font-size: 16px; }
.acordeon[open] .acordeon-chevron { transform: rotate(180deg); }

.acordeon-cuerpo { padding: 20px 18px 26px; }
.acordeon-cuerpo fieldset { border: none; box-shadow: none; padding: 0; margin: 0; background: transparent; }
.acordeon-cuerpo legend { display: none; }
.acordeon-cuerpo > label:first-child { margin-top: 0; }

.fila-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.btn, button, input[type=submit] {
    display: inline-block;
    padding: 15px 18px;
    border: 1.5px solid var(--borde);
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    background: #fff;
    color: var(--texto-suave);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}
.btn:active, button:active { transform: scale(0.98); }

.btn-primario, button[type=submit] {
    width: 100%;
}
.btn-primario:hover, button[type=submit]:hover { background: #f5efe0; color: var(--azul); border-color: #e6dcc0; }

.btn-secundario {
    background: #fff;
    color: var(--azul);
    border: 1.5px solid var(--azul);
}
.btn-secundario:hover { background: #f5efe0; }

.btn-terciario, .btn-chico {
    background: #eee;
    color: #333;
    border: 1px solid #ccc;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 14px;
}
.btn-terciario:hover { background: #e2e2e2; }

.btn-bloque { display: block; width: 100%; }

/* ------------------------------------------------------------
   Mensajes de estado
   ------------------------------------------------------------ */
.alerta {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.55;
}
.alerta-error { background: #fce9e9; color: #8f1d1d; border: 1px solid #f3c8c8; }
.alerta-exito { background: #e5f5ea; color: #16603a; border: 1px solid #bfe6cd; }

/* ------------------------------------------------------------
   Avatares (foto o iniciales)
   ------------------------------------------------------------ */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #5c4600;
    background: var(--dorado-suave);
}
.avatar-chico { width: 42px; height: 42px; font-size: 15px; }
.avatar-mediano { width: 56px; height: 56px; font-size: 18px; }
.avatar-grande { width: 76px; height: 76px; font-size: 24px; }

/* ------------------------------------------------------------
   Pie de página
   ------------------------------------------------------------ */
footer.pie-institucional {
    text-align: center;
    font-size: 12.5px;
    color: #cfc7b3;
    padding: 22px 12px 28px;
    flex-shrink: 0;
    line-height: 1.7;
    background: var(--oscuro-footer);
    margin-top: auto;
}
.pie-desarrollador {
    display: block;
    font-size: 11.5px;
    color: #96897a;
    margin-top: 4px;
}
.pie-desarrollador a {
    color: var(--dorado);
    text-decoration: underline;
}
.pie-desarrollador a:hover { color: #fff; }

/* ------------------------------------------------------------
   Utilidades
   ------------------------------------------------------------ */
.texto-centrado { text-align: center; }
.texto-suave { color: var(--texto-suave); font-size: 14.5px; }
.espaciador-chico { margin-top: 10px; }
.espaciador { margin-top: 20px; }

/* ------------------------------------------------------------
   Llamado a la acción (ej. invitación a registrarse)
   ------------------------------------------------------------ */
.cta-registro {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    background: linear-gradient(135deg, #fbf6e8 0%, #f7f0dc 100%);
    border: 1px solid #ecdfb8; border-radius: var(--radio);
    padding: 16px 18px; margin-top: 16px;
}
.cta-registro-texto { font-size: 14.5px; color: #6b5a2c; line-height: 1.45; }
.cta-registro-texto strong { display: block; color: var(--azul); font-size: 15.5px; margin-bottom: 3px; }
.cta-registro-boton {
    display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
    background: #fff; color: var(--texto-suave); font-size: 14px; font-weight: 700;
    padding: 11px 18px; border-radius: 4px; text-decoration: none;
    border: 1.5px solid var(--borde);
    white-space: nowrap; transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.cta-registro-boton:hover { background: #eaf5ee; color: var(--verde); border-color: #cbe6d6; transform: translateY(-1px); }
.cta-registro-boton svg { width: 17px; height: 17px; }

@media (max-width: 420px) {
    .cta-registro { flex-direction: column; align-items: stretch; text-align: center; }
    .cta-registro-boton { justify-content: center; }
}

/* ------------------------------------------------------------
   Enlace de navegación secundaria (ej. "Volver")
   ------------------------------------------------------------ */
.enlace-volver-central {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 22px; font-size: 14.5px; font-weight: 600; color: var(--texto-suave);
    text-decoration: none; transition: color 0.15s ease;
}
.enlace-volver-central:hover { color: var(--azul); }
.enlace-volver-central svg { width: 17px; height: 17px; }
