/* ============================================================
   login.css — Estilos para la pantalla de inicio de sesión SIPAD
   ============================================================ */

/* Importar fuente Inter desde Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Reset y fondo de página ── */
body.login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    background: radial-gradient(ellipse at 60% 20%, #18448D 0%, #0B1B3D 55%, #060e20 100%);
    overflow: hidden;
}

/* Partículas decorativas de fondo */
body.login-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 85%, rgba(24, 68, 141, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 85% 15%, rgba(212, 162, 47, 0.10) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* ── Card principal ── */
.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    margin: 24px;
    background: rgba(15, 33, 71, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 20px;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.50),
        0 0 0 1px rgba(212, 162, 47, 0.08) inset;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 44px 40px 36px;
    animation: cardIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(28px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* ── Fila de logos (UNACH + DDA) ── */
.login-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 22px;
}

.login-logo-item {
    flex-shrink: 0;
}

.login-logo-item img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    border-radius: 50%;
    background: #ffffff;
    padding: 8px;
    border: 2px solid rgba(212, 162, 47, 0.45);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.30));
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-logo-item img:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 20px rgba(212, 162, 47, 0.25);
}

/* Separador vertical entre logos */
.login-logo-divider {
    width: 1px;
    height: 48px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(212, 162, 47, 0.40) 30%,
        rgba(212, 162, 47, 0.40) 70%,
        transparent 100%
    );
}

/* ── Títulos ── */
.login-title {
    text-align: center;
    color: #ffffff;
    font-size: 1.90rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0 0 4px;
}

.login-subtitle {
    text-align: center;
    color: rgba(180, 198, 230, 0.75);
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.4;
    margin: 0 0 32px;
}

/* ── Mensajes de error ── */
.login-messages {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.35);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 20px;
    color: #f5a8b0;
    font-size: 0.82rem;
}
.login-messages ul {
    margin: 0;
    padding-left: 16px;
}

/* ── Botón principal (OAuth UNACH) ── */
.btn-login-primary {
    display: grid;
    grid-template-columns: 1.4rem 1fr 1.4rem; /* ícono | texto centrado | hueco espejo */
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #D4A22F 0%, #c4911a 100%);
    color: #0B1B3D;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    box-shadow: 0 4px 18px rgba(212, 162, 47, 0.35);
    letter-spacing: 0.01em;
    box-sizing: border-box;
}

.btn-login-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(212, 162, 47, 0.50);
    filter: brightness(1.06);
    color: #0B1B3D;
    text-decoration: none;
}

.btn-login-primary:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(212, 162, 47, 0.30);
}

.btn-login-primary .btn-icon {
    font-size: 1.1rem;
    line-height: 1;
    text-align: left;
}

/* Texto centrado en la columna central del grid */
.btn-login-primary span:not(.btn-icon) {
    text-align: center;
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
}

/* ── Separador ── */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 20px;
    color: rgba(180, 198, 230, 0.35);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.10);
}

/* ── Enlace de acceso alternativo (discreto) ── */
.btn-login-alt-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 8px 16px;
    background: transparent;
    color: rgba(180, 198, 230, 0.50);
    font-family: 'Inter', sans-serif;
    font-size: 0.80rem;
    font-weight: 400;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
    letter-spacing: 0.02em;
}

.btn-login-alt-trigger:hover {
    color: rgba(180, 198, 230, 0.85);
    background: rgba(255, 255, 255, 0.04);
    text-decoration: none;
}

.btn-login-alt-trigger .alt-icon {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ── Panel de login alternativo (formulario) ── */
.login-alt-panel {
    display: none;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 22px;
    animation: panelIn 0.3s ease both;
}

@keyframes panelIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-alt-panel h6 {
    color: rgba(180, 198, 230, 0.60);
    font-size: 0.73rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 16px;
    text-align: center;
}

/* ── Inputs del formulario alternativo ── */
.login-alt-panel .form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #e8edf5;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    padding: 10px 14px;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.login-alt-panel .form-control::placeholder {
    color: rgba(180, 198, 230, 0.40);
}

.login-alt-panel .form-control:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(212, 162, 47, 0.55);
    box-shadow: 0 0 0 3px rgba(212, 162, 47, 0.12);
    color: #ffffff;
    outline: none;
}

/* ── Botón de submit del formulario alternativo ── */
.btn-login-submit {
    width: 100%;
    padding: 11px 20px;
    background: rgba(24, 68, 141, 0.60);
    border: 1px solid rgba(24, 68, 141, 0.80);
    border-radius: 10px;
    color: #e8edf5;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    margin-top: 4px;
}

.btn-login-submit:hover {
    background: rgba(24, 68, 141, 0.85);
    border-color: rgba(24, 68, 141, 1);
    transform: translateY(-1px);
}

/* ── Error en formulario alternativo ── */
.login-form-error {
    color: #f5a8b0;
    font-size: 0.80rem;
    margin-bottom: 12px;
    text-align: center;
}

/* ── Footer de la card ── */
.login-footer {
    text-align: center;
    color: rgba(180, 198, 230, 0.28);
    font-size: 0.70rem;
    margin-top: 28px;
    letter-spacing: 0.03em;
}

/* ============================================================
   RESPONSIVE — Mobile First
   ============================================================ */

/* ── Tablet y escritorio pequeño (≤ 600px) ── */
@media (max-width: 600px) {

    /* Permitir scroll vertical en pantallas pequeñas */
    body.login-page {
        align-items: flex-start;
        padding: 20px 0 40px;
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* Card ocupa casi toda la pantalla con márgenes mínimos */
    .login-card {
        margin: 0 12px;
        padding: 32px 22px 28px;
        border-radius: 16px;
        max-width: 100%;
    }

    /* Logos un poco más pequeños */
    .login-logo-item img {
        width: 62px;
        height: 62px;
        padding: 7px;
    }

    .login-logo-divider {
        height: 38px;
    }

    .login-logos {
        gap: 12px;
        margin-bottom: 18px;
    }

    /* Tipografía ajustada */
    .login-title {
        font-size: 1.55rem;
    }

    .login-subtitle {
        font-size: 0.76rem;
        margin-bottom: 24px;
    }

    /* Botón OAuth con texto que no se corte */
    .btn-login-primary {
        font-size: 0.88rem;
        padding: 13px 14px;
        gap: 8px;
    }

    /* Inputs más grandes para facilitar el toque */
    .login-alt-panel .form-control {
        font-size: 1rem;          /* Evita zoom automático en iOS (≥16px en inputs) */
        padding: 12px 14px;
    }

    .btn-login-submit {
        font-size: 1rem;
        padding: 13px 20px;
    }

    /* Área de toque generosa en botón alternativo */
    .btn-login-alt-trigger {
        padding: 12px 16px;
        font-size: 0.82rem;
    }
}

/* ── Móvil muy pequeño (≤ 360px) ── */
@media (max-width: 360px) {

    .login-card {
        margin: 0 8px;
        padding: 26px 16px 24px;
    }

    .login-logo-item img {
        width: 54px;
        height: 54px;
    }

    .login-title {
        font-size: 1.35rem;
    }

    .login-subtitle {
        font-size: 0.72rem;
    }

    .btn-login-primary {
        font-size: 0.84rem;
    }
}

/* ── Tablets en portrait (601px – 768px) ── */
@media (min-width: 601px) and (max-width: 768px) {

    .login-card {
        max-width: 460px;
        padding: 40px 36px 32px;
    }
}
