/* ============================================
   LOGIN PAGE — Paleta PCR Oficial
   ============================================ */

:root {
    --pcr-bone:      #e5dac8;
    --pcr-jelly:     #497f87;
    --pcr-columbia:  #c1e4dd;
    --pcr-chocolate: #5e0925;
    --pcr-sand:      #ecb7a2;
    --pcr-dark:      #1a1a1a;
    
    --login-bg:           var(--pcr-bone);
    --login-primary:      #2d4f55;
    --login-overlay:      rgba(45, 79, 85, 0.90);
    --login-accent:       var(--pcr-sand);
    --login-card-bg:      #faf8f5;
    --login-card-border:  #d4c9b8;
}

.login-page {
    padding-top: 0 !important;
    background-color: var(--login-bg);
    min-height: 100vh;
}

.login-wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- Panel Hero --- */
.login-hero-panel {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;      /* Centrado vertical del contenido */
    justify-content: center;
    padding: 3rem;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: url('/assets/images/APS.webp') top left/cover no-repeat;
}

.hero-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--login-overlay);
}

.hero-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

.login-hero-panel::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(236, 183, 162, 0.10) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 440px;
    color: rgba(255, 255, 255, 0.85);
    /* Eliminamos padding-bottom extra, el contenido fluye natural */
}

.hero-brand { display: none; }

.hero-title {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.hero-highlight {
    color: var(--login-accent);
    display: block;
    margin-top: 0.5rem;
    font-weight: 600;
}

.hero-lead {
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.60);
    margin-bottom: 2.5rem;    /* Reducido ligeramente */
    font-weight: 300;
}

.hero-features {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hero-feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.feature-icon-bg {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.feature-icon-bg i {
    font-size: 1.1rem;
    color: var(--login-accent);
}

.feature-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    color: rgba(255, 255, 255, 0.90);
}

.feature-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.50);
    line-height: 1.4;
}

/* FIX #2: Footer del hero — ya no absolute, fluye natural */
.hero-footer {
    margin-top: 2.5rem;       /* Espacio desde las features */
    color: rgba(255, 255, 255, 0.30);
    font-size: 0.75rem;
    /* Eliminado: position: absolute, bottom, left */
}

/* --- Panel Formulario --- */
.login-form-panel {
    flex: 0 0 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--login-bg);
}

.form-container {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    /* Altura completa para distribuir espacio */
    min-height: calc(100vh - 4rem);
}

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
    /* Empuja hacia abajo desde el top */
    padding-top: 2rem;
}

.form-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--login-primary);
    margin-bottom: 0.4rem;
}

.form-subtitle {
    font-size: 0.95rem;
    color: #8a8278;
    margin-bottom: 0;
}

/* --- Tarjeta Azure --- */
.card-pcr-azure {
    border: 1px solid var(--login-card-border);
    border-radius: 12px;
    background: var(--login-card-bg);
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(93, 9, 37, 0.04);
}

.card-pcr-azure:hover {
    border-color: var(--pcr-jelly);
    box-shadow: 0 8px 24px rgba(73, 127, 135, 0.12);
    transform: translateY(-2px);
}

.card-pcr-azure:focus-visible {
    outline: 3px solid var(--pcr-jelly);
    outline-offset: 2px;
}

.card-pcr-azure.card-loading {
    opacity: 0.7;
    pointer-events: none;
}

.text-azure {
    color: #0078d4;
}

.btn-azure {
    background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-azure:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 120, 212, 0.25);
    color: white;
}

.btn-azure:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner-pcr {
    width: 36px;
    height: 36px;
    border: 3px solid var(--login-card-border);
    border-top-color: var(--pcr-jelly);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* FIX #1: Footer del formulario — sin borde superior, al fondo */
.form-footer {
    text-align: center;
    /* ELIMINADO: border-top: 1px solid #d4c9b8; */
    margin-top: auto;         /* Empuja al fondo del contenedor */
    padding-bottom: 1.5rem;   /* Espacio desde el borde inferior */
}

.link-pcr {
    color: var(--pcr-jelly);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.link-pcr:hover {
    color: var(--login-primary);
    text-decoration: underline;
}

.version-text {
    font-family: 'SF Mono', monospace;
    opacity: 0.5;
    font-size: 0.75rem;
    color: #9a9084;
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
    .login-wrapper { flex-direction: column; }
    .login-hero-panel { display: none !important; }
    .login-form-panel {
        flex: 1;
        padding: 1.5rem;
        align-items: flex-start;
        padding-top: 3rem;
    }
    .form-container {
        justify-content: flex-start;
        min-height: auto;
    }
    .form-header { padding-top: 0; }
    .form-footer {
        margin-top: 2rem;
        padding-bottom: 1rem;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .login-hero-panel { padding: 2rem; }
    .hero-title { font-size: 2.25rem; }
    .login-form-panel { flex: 0 0 420px; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-form-panel .form-container {
    animation: fadeInUp 0.6s ease-out;
}