﻿/* ========================================
   MICROSITIO BIENESTAR ESTUDIANTIL — SHELL COMPARTIDO
   Prefijo BEM: bie-*
   Usado por: landings/bienestarEstudiantil/index.html
              landings/bienestarEstudiantil/solicitar-cita.html
              landings/bienestarEstudiantil/referir-estudiante.html
              landings/bienestarEstudiantil/emergencia-psicologica.html
              landings/bienestarEstudiantil/acceso-personal.html
   Contiene: tokens del micrositio, botones, encabezados de sección,
             placeholders, modal de emergencia y soporte de
             prefers-reduced-motion.
   Sin header ni footer: los añade el sitio principal (ver ARCHITECTURE.md).
   Reutiliza tokens de global.css y tailwind-config.js
   ======================================== */

.bie-page {
    --bie-blue: #0a3859;
    --bie-blue-deep: #06263d;
    --bie-green: #156b1d;
    --bie-green-light: #439441;
    --bie-ink: #191c1d;
    --bie-muted: #40493d;
    --bie-line: rgba(10, 56, 89, 0.12);
    --bie-surface: #ffffff;
    --bie-surface-soft: #f3f6f2;
    --bie-urgent: #ba1a1a;
    --bie-urgent-soft: #ffdad6;
    --bie-grad: linear-gradient(120deg, #0a3859 0%, #156b1d 100%);
}

/* --- Contenedor --- */
.bie-wrap {
    width: 100%;
    max-width: 82rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

@media (min-width: 768px) {
    .bie-wrap {
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }
}

@media (min-width: 1280px) {
    .bie-wrap {
        padding-left: 3.5rem;
        padding-right: 3.5rem;
    }
}

/* --- Botones --- */
.bie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    border-radius: 9999px;
    padding: 0.875rem 1.75rem;
    font-size: var(--text-btn-size);
    font-weight: var(--text-btn-weight);
    letter-spacing: var(--text-btn-tracking);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.bie-btn:hover {
    transform: translateY(-2px);
}

.bie-btn--sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.bie-btn--primary {
    background: var(--bie-green);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(21, 107, 29, 0.25);
}

.bie-btn--primary:hover {
    background: #11571a;
}

.bie-btn--light {
    background: #ffffff;
    color: var(--bie-blue);
    box-shadow: 0 12px 28px rgba(10, 56, 89, 0.18);
}

.bie-btn--ghost {
    border-color: rgba(255, 255, 255, 0.55);
    color: #ffffff;
}

.bie-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.12);
}

.bie-btn--outline {
    border-color: var(--bie-line);
    background: #ffffff;
    color: var(--bie-blue);
}

.bie-btn--outline:hover {
    border-color: var(--bie-green);
    color: var(--bie-green);
}

/* Único uso del rojo del sistema: la emergencia psicológica */
.bie-btn--urgent {
    background: var(--bie-urgent);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(186, 26, 26, 0.22);
}

.bie-btn--urgent:hover {
    background: #8f0f0f;
}

.bie-btn[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.65;
    box-shadow: none;
}

.bie-btn[aria-disabled="true"]:hover {
    transform: none;
}

/* --- Encabezados de sección --- */
.bie-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-eyebrow-size);
    font-weight: var(--text-eyebrow-weight);
    letter-spacing: var(--text-eyebrow-tracking);
    text-transform: uppercase;
    color: var(--bie-green);
}

.bie-eyebrow--light {
    color: rgba(255, 255, 255, 0.82);
}

.bie-section-title {
    font-size: clamp(1.75rem, 3.4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--bie-blue);
}

.bie-section-title--light {
    color: #ffffff;
}

.bie-section-lead {
    font-size: var(--text-lead-size);
    line-height: 1.7;
    color: var(--bie-muted);
}

/* --- Placeholders de contenido pendiente --- */
.bie-placeholder {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px dashed rgba(10, 56, 89, 0.3);
    border-radius: 9999px;
    background: rgba(10, 56, 89, 0.04);
    padding: 0.375rem 0.875rem;
    color: var(--bie-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.bie-placeholder .material-symbols-outlined {
    font-size: 1rem;
}

.bie-placeholder--light {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
}

.bie-placeholder-block {
    border: 1px dashed rgba(10, 56, 89, 0.25);
    border-radius: 1rem;
    background: rgba(10, 56, 89, 0.03);
    padding: 1.5rem;
    color: var(--bie-muted);
}

/* --- Modal de emergencia psicológica --- */
.bie-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(6, 38, 61, 0.72);
}

.bie-modal[hidden] {
    display: none;
}

.bie-modal__panel {
    width: min(92vw, 34rem);
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    border-radius: 1.5rem;
    background: #ffffff;
    padding: 1.75rem;
    box-shadow: 0 24px 64px rgba(6, 38, 61, 0.35);
}

@media (min-width: 768px) {
    .bie-modal__panel {
        padding: 2.25rem;
    }
}

.bie-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.bie-modal__title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--bie-blue);
}

.bie-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 9999px;
    background: #f3f4f5;
    color: var(--bie-ink);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.bie-modal__close:hover {
    background: #e1e3e4;
}

.bie-modal__lead {
    margin-top: 0.875rem;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--bie-muted);
}

.bie-modal__note {
    margin-top: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--bie-muted);
}

.bie-modal__footer {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* --- Pasos del protocolo de emergencia (modal y página dedicada) --- */
.bie-steps {
    display: grid;
    gap: 0.875rem;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}

.bie-step {
    display: flex;
    gap: 0.875rem;
    border: 1px solid var(--bie-line);
    border-radius: 1rem;
    background: #ffffff;
    padding: 1rem 1.125rem;
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--bie-muted);
}

.bie-step__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    background: rgba(21, 107, 29, 0.1);
    color: var(--bie-green);
}

/* Variante numerada: pasos de un procedimiento en lugar de un protocolo */
.bie-step__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    background: rgba(21, 107, 29, 0.1);
    color: var(--bie-green);
    font-size: 0.875rem;
    font-weight: 700;
}

.bie-step__action {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.75rem;
    border-radius: 9999px;
    background: var(--bie-surface-soft);
    padding: 0.375rem 0.875rem;
    color: var(--bie-blue);
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
}

.bie-step__action:hover {
    background: rgba(21, 107, 29, 0.12);
    color: var(--bie-green);
}

.bie-step__action .material-symbols-outlined {
    font-size: 1rem;
}

/* Paso crítico: contacto con el 9-1-1 */
.bie-step--urgent {
    border-color: rgba(186, 26, 26, 0.3);
    background: rgba(186, 26, 26, 0.04);
}

.bie-step--urgent .bie-step__icon {
    background: var(--bie-urgent-soft);
    color: var(--bie-urgent);
}

.bie-step--urgent .bie-step__action {
    background: var(--bie-urgent-soft);
    color: #8f0f0f;
}

.bie-step strong {
    color: var(--bie-blue);
}

/* --- Errores de validación (los pinta forms.js) --- */
.bie-page .field-error {
    display: none;
    margin-top: 0.375rem;
    color: var(--bie-urgent);
    font-size: 0.8125rem;
    font-weight: 600;
}

.bie-page input.error,
.bie-page select.error,
.bie-page textarea.error {
    border-color: var(--bie-urgent);
    box-shadow: 0 0 0 3px rgba(186, 26, 26, 0.12);
}

/* --- Foco visible consistente --- */
.bie-page a:focus-visible,
.bie-page button:focus-visible,
.bie-page [tabindex]:focus-visible,
.bie-page summary:focus-visible,
.bie-page input:focus-visible,
.bie-page select:focus-visible,
.bie-page textarea:focus-visible {
    outline: 3px solid var(--bie-green-light);
    outline-offset: 3px;
    border-radius: 0.5rem;
}

.bie-page .bie-btn--ghost:focus-visible {
    outline-color: #ffffff;
}

/* --- Margen para los anclajes internos (#contacto, #servicios…) --- */
.bie-page section[id] {
    scroll-margin-top: 1.5rem;
}

/* --- Accesibilidad: movimiento reducido --- */
@media (prefers-reduced-motion: reduce) {
    .bie-page *,
    .bie-page *::before,
    .bie-page *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    .bie-page [data-animate="fade"],
    .bie-page [data-stagger] {
        opacity: 1 !important;
        transform: none !important;
    }

    .bie-page .bie-btn:hover,
    .bie-page .card-hover:hover {
        transform: none;
    }
}
