/* ==========================================================
   Módulo de Acceso — REMAR
   Misma identidad visual que el portal anterior (verde REMAR),
   reescrita como hoja de estilos reutilizable en vez de estilos
   inline repetidos en cada página.
   ========================================================== */

:root {
    --remar-primary: #A2BD32;
    --remar-primary-dark: #8BA428;
    --remar-gradient: linear-gradient(135deg, var(--remar-primary) 0%, var(--remar-primary-dark) 100%);
    --remar-bg-gradient: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    --remar-text: #374151;
    --remar-text-muted: #6b7280;
    --remar-border: #d1d5db;
    --remar-error-bg: #fee2e2;
    --remar-error-border: #dc2626;
    --remar-error-text: #991b1b;
}

.acceso-fondo {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--remar-bg-gradient);
}

/* ---------- Tarjetas ---------- */
.acceso-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 460px;
    padding: 2rem;
    animation: acceso-fade-in 0.4s ease;
}

.acceso-card--ancha {
    max-width: 600px;
}

@keyframes acceso-fade-in {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Encabezado de login ---------- */
.acceso-header {
    text-align: center;
    margin-bottom: 2rem;
}

.acceso-header__icono {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.acceso-header__titulo {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--remar-text);
    margin-bottom: 0.25rem;
}

.acceso-header__subtitulo {
    font-size: 0.9rem;
    color: var(--remar-text-muted);
}

/* ---------- Formulario ---------- */
.acceso-campo {
    margin-bottom: 1.25rem;
}

.acceso-etiqueta {
    display: block;
    font-weight: 600;
    color: var(--remar-text);
    margin-bottom: 0.4rem;
    font-size: 0.9375rem;
}

.acceso-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 16px;
    border: 2px solid var(--remar-border);
    border-radius: 0.75rem;
    background: #f9fafb;
    transition: all 0.2s ease;
}

.acceso-input:focus {
    outline: none;
    border-color: var(--remar-primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(162, 189, 50, 0.1);
}

.acceso-consentimiento {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: #f0fdf4;
    border-radius: 0.75rem;
    border: 2px solid #bbf7d0;
    margin-bottom: 1.5rem;
}

.acceso-consentimiento input {
    width: 1.5rem;
    height: 1.5rem;
    accent-color: var(--remar-primary);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.acceso-consentimiento__texto {
    flex: 1;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--remar-text);
    text-align: justify;
}

/* ---------- Botones ---------- */
.acceso-btn-primario {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    background: var(--remar-gradient);
    color: white;
    border-radius: 0.75rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(162, 189, 50, 0.2);
}

.acceso-btn-primario:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(162, 189, 50, 0.3);
}

.acceso-btn-primario:active {
    transform: scale(0.98);
}

.acceso-btn-secundario {
    width: 100%;
    padding: 0.75rem;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    color: var(--remar-text-muted);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.acceso-btn-secundario:hover {
    background: var(--remar-error-bg);
    border-color: var(--remar-error-border);
    color: var(--remar-error-border);
}

.acceso-mensaje-error {
    background: var(--remar-error-bg);
    border: 2px solid var(--remar-error-border);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-top: 1rem;
    color: var(--remar-error-text);
    font-weight: 600;
    text-align: center;
}

/* ---------- Panel post-login ---------- */
.acceso-panel__header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.acceso-panel__saludo {
    font-size: 2rem;
}

.acceso-panel__titulo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--remar-text);
}

.acceso-panel__usuario {
    font-size: 0.95rem;
    color: var(--remar-text-muted);
    margin-top: 0.25rem;
}

.acceso-divisor {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 1.25rem 0;
}

.acceso-etiqueta-seccion {
    font-size: 0.75rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.acceso-grid-modulos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.875rem;
}

.acceso-btn-modulo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    border: 2px solid var(--remar-primary);
    background: var(--remar-gradient);
    color: white;
    border-radius: 0.875rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(162, 189, 50, 0.2);
    width: 100%;
}

.acceso-btn-modulo:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(162, 189, 50, 0.3);
}

.acceso-btn-modulo__icono {
    font-size: 1.75rem;
}

/* ---------- Modales ---------- */
.acceso-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    animation: acceso-fade-in 0.15s ease;
}

.acceso-modal-box {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    text-align: center;
    /* Nunca más alto que la ventana: si no cabe, el cuadro se desplaza por dentro y todos los botones siguen alcanzables. */
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.acceso-modal-box--ancha {
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.acceso-modal-icono {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.acceso-modal-titulo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--remar-text);
    margin-bottom: 0.25rem;
}

.acceso-modal-subtitulo {
    font-size: 0.85rem;
    color: var(--remar-text-muted);
    margin-bottom: 1.25rem;
}

.acceso-modal-input {
    width: 100%;
    padding: 0.875rem;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.5rem;
    border: 2px solid var(--remar-border);
    border-radius: 0.75rem;
    background: #f9fafb;
    margin-bottom: 1rem;
}

.acceso-modal-input:focus {
    outline: none;
    border-color: var(--remar-primary);
    background: white;
}

.acceso-modal-error {
    color: var(--remar-error-border);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    min-height: 1.2rem;
}

.acceso-modal-botones {
    display: flex;
    gap: 0.75rem;
}

.acceso-modal-btn-ok {
    flex: 1;
    padding: 0.75rem;
    background: var(--remar-gradient);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
}

.acceso-modal-btn-cancelar {
    flex: 1;
    padding: 0.75rem;
    background: #f3f4f6;
    color: var(--remar-text-muted);
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}

.acceso-grid-puntos {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
    text-align: left;
}

.acceso-btn-punto {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: 2px solid var(--remar-primary);
    background: var(--remar-gradient);
    color: white;
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    width: 100%;
    transition: all 0.2s;
}

.acceso-btn-punto:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(162, 189, 50, 0.3);
}

.acceso-btn-submenu {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border: 2px solid var(--remar-primary);
    background: var(--remar-gradient);
    color: white;
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    width: 100%;
    transition: all 0.2s;
    margin-bottom: 0.75rem;
}

.acceso-btn-submenu:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(162, 189, 50, 0.3);
}

@media (max-width: 480px) {
    .acceso-card, .acceso-card--ancha {
        padding: 1.5rem;
    }

    .acceso-grid-modulos {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Ventanas poco altas (portátiles, navegador reducido): botones y espacios más compactos para ver más opciones a la vez. */
@media (max-height: 820px) {
    .acceso-modal-box { padding: 1.25rem 1.5rem; }
    .acceso-modal-icono { font-size: 1.8rem; margin-bottom: 0.4rem; }
    .acceso-modal-subtitulo { margin-bottom: 0.75rem; }
    .acceso-btn-submenu { padding: 0.65rem 1rem; margin-bottom: 0.5rem; font-size: 0.95rem; }
}

/* Computador: el panel de gestión más ancho (en teléfono se queda igual). */
@media (min-width: 1100px) {
    .acceso-card--ancha { max-width: 960px; }
}
