﻿/* ========================================
   NEO ÁGORA - LOGIN PAGE STYLES v2.1
   Sincronizado con login.js
   ======================================== */

/* ========================================
   RESET Y BASE
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    width: 100%;
    min-height: 100vh;
}

/* ========================================
   PÁGINA PRINCIPAL - OCUPA TODO
   ======================================== */
.login-page {
    width: 100% !important;
    min-height: 100vh !important;
    max-width: none !important;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 40%, #e2e8f0 100%);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
}

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */
.login-container {
    width: 100%;
    max-width: 1200px;
    min-height: 680px;
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.12), 0 10px 40px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ========================================
   BREADCRUMB
   ======================================== */
.login-breadcrumb {
    padding: 1rem 2rem;
    background: linear-gradient(90deg, #fafafa 0%, #ffffff 100%);
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    font-size: 0.875rem;
    color: #6c757d;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

    .breadcrumb-item:not(:last-child)::after {
        content: '/';
        margin-left: 0.5rem;
        color: #dee2e6;
    }

.breadcrumb-link {
    color: #111827;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

    .breadcrumb-link:hover {
        color: #374151;
    }

.breadcrumb-current {
    color: #495057;
    font-weight: 600;
}

/* ========================================
   CONTENIDO - GRID 2 COLUMNAS
   ======================================== */
.login-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1;
    min-height: 0;
}

/* ========================================
   COLUMNA IZQUIERDA - FORMULARIO
   ======================================== */
.login-form-column {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

    /* Animación shake para errores */
    .login-form-column.shake {
        animation: shake 0.5s ease-in-out;
    }

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    20%, 60% {
        transform: translateX(-8px);
    }

    40%, 80% {
        transform: translateX(8px);
    }
}

/* Header del formulario */
.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

    .form-header h1 {
        font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
        font-size: 2.25rem;
        font-weight: 700;
        color: #1a1a2e;
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        line-height: 1.2;
    }

        .form-header h1 i {
            color: #111827;
            font-size: 2.25rem;
        }

    .form-header p {
        color: #6c757d;
        font-size: 1.0625rem;
        line-height: 1.5;
        margin: 0;
    }

/* ========================================
   ALERTAS
   ======================================== */
.alert {
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    border-left: 4px solid;
    font-size: 0.9375rem;
    line-height: 1.5;
}

    /* Ocultar alertas vacías */
    .alert:empty,
    .validation-summary-valid {
        display: none !important;
    }

.alert-danger {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-left-color: #ef5350;
    color: #c62828;
}

.alert-success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-left-color: #66bb6a;
    color: #2e7d32;
}

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* ========================================
   RATE LIMIT WARNING
   Clase JS: is-visible
   ======================================== */
.rate-limit-warning {
    display: none;
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border-left: 4px solid #ffa726;
    color: #e65100;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    align-items: center;
    gap: 0.875rem;
    font-size: 0.9375rem;
}

    .rate-limit-warning.is-visible {
        display: flex;
    }

.rate-limit-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.rate-limit-timer {
    font-weight: 700;
    color: #d84315;
}

/* ========================================
   BOTONES SOCIALES
   ======================================== */
.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-social {
    padding: 0.9375rem 1.25rem;
    border: 2px solid;
    border-radius: 12px;
    background: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 0.9375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-google {
    border-color: #ea4335;
    color: #ea4335;
}

    .btn-google:hover {
        background: #ea4335;
        color: #ffffff;
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(234, 67, 53, 0.35);
    }

.btn-facebook {
    border-color: #1877f2;
    color: #1877f2;
}

    .btn-facebook:hover {
        background: #1877f2;
        color: #ffffff;
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(24, 119, 242, 0.35);
    }

/* ========================================
   DIVISOR
   ======================================== */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.75rem 0;
    color: #9e9e9e;
    font-size: 0.875rem;
    font-weight: 500;
}

    .divider::before,
    .divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: linear-gradient(90deg, transparent, #e0e0e0, transparent);
    }

.divider-text {
    padding: 0 1.25rem;
    white-space: nowrap;
}

/* ========================================
   FORMULARIO - CAMPOS
   ======================================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #37474f;
    margin-bottom: 0.625rem;
    font-size: 0.9375rem;
}

    .form-label i {
        color: #111827;
        margin-right: 0.5rem;
        font-size: 0.875rem;
        width: 1rem;
        text-align: center;
    }

    .form-label .required {
        color: #111827;
        margin-left: 0.25rem;
    }

.form-control {
    width: 100%;
    padding: 0.9375rem 1.125rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    background: #fafafa;
    transition: all 0.25s ease;
    outline: none;
    color: #212529;
}

    .form-control:hover {
        border-color: #bdbdbd;
    }

    .form-control:focus {
        border-color: #111827;
        background: #ffffff;
        box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.08);
    }

    .form-control::placeholder {
        color: #9e9e9e;
    }

    /* Estados de validación */
    .form-control.is-valid {
        border-color: #66bb6a;
        background: #f1f8f1;
    }

    .form-control.is-invalid {
        border-color: #ef5350;
        background: #fff8f8;
    }

/* Mensajes de validación */
.validation-message,
.field-validation-error {
    display: block;
    font-size: 0.8125rem;
    color: #e53935;
    margin-top: 0.5rem;
    padding-left: 0.25rem;
}

    .validation-message:empty,
    .field-validation-error:empty,
    .field-validation-valid {
        display: none;
    }

/* ========================================
   CAMPO CONTRASEÑA
   ======================================== */
.password-wrapper {
    position: relative;
}

    .password-wrapper .form-control {
        padding-right: 3.5rem;
    }

.password-toggle {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #757575;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

    .password-toggle:hover {
        color: #111827;
        background: rgba(17, 24, 39, 0.06);
    }

/* Caps Lock Warning */
.caps-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #fff3e0;
    border-radius: 8px;
    font-size: 0.8125rem;
    color: #e65100;
}

    .caps-warning.is-hidden {
        display: none;
    }

    .caps-warning i {
        font-size: 0.875rem;
    }

/* ========================================
   OPCIONES - RECORDARME
   ======================================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
}

.form-check-input {
    width: 20px;
    height: 20px;
    border: 2px solid #bdbdbd;
    border-radius: 5px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex-shrink: 0;
}

    .form-check-input:hover {
        border-color: #111827;
    }

    .form-check-input:checked {
        background: #111827;
        border-color: #111827;
    }

        .form-check-input:checked::after {
            content: '✓';
            color: #ffffff;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 12px;
            font-weight: 700;
            line-height: 1;
        }

    .form-check-input:focus {
        box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.12);
    }

.form-check-label {
    font-weight: 500;
    color: #546e7a;
    font-size: 0.9375rem;
    user-select: none;
}

.forgot-link {
    color: #111827;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

    .forgot-link:hover {
        color: #374151;
        text-decoration: underline;
    }

/* ========================================
   BOTÓN SUBMIT
   Clase JS: is-loading
   ======================================== */
.btn-submit {
    width: 100%;
    padding: 1.0625rem 1.5rem;
    background: linear-gradient(135deg, #111827 0%, #374151 50%, #1f2937 100%);
    border: none;
    border-radius: 14px;
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 1.0625rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

    .btn-submit:hover:not(:disabled) {
        transform: translateY(-3px);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    }

    .btn-submit:active:not(:disabled) {
        transform: translateY(-1px);
    }

    .btn-submit:disabled {
        opacity: 0.7;
        cursor: not-allowed;
        transform: none;
    }

    /* Estado de carga */
    .btn-submit .btn-spinner {
        display: none;
    }

    .btn-submit.is-loading .btn-text,
    .btn-submit.is-loading .btn-icon {
        display: none;
    }

    .btn-submit.is-loading .btn-spinner {
        display: inline-block;
    }

/* ========================================
   REGISTRO LINK
   ======================================== */
.register-prompt {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.75rem;
    border-top: 1px solid #f0f0f0;
    color: #78909c;
    font-size: 0.9375rem;
}

.register-link {
    color: #111827;
    font-weight: 700;
    text-decoration: none;
    margin-left: 0.25rem;
    transition: all 0.2s ease;
}

    .register-link:hover {
        color: #374151;
        text-decoration: underline;
    }

/* ========================================
   COLUMNA DERECHA - CARACTERÍSTICAS
   ======================================== */
.features-column {
    padding: 3rem;
    background: linear-gradient(145deg, #fafafa 0%, #f5f5f5 100%);
    border-left: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.features-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

    .features-header h2 {
        font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
        font-size: 1.875rem;
        font-weight: 700;
        color: #1a1a2e;
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        line-height: 1.2;
    }

        .features-header h2 i {
            color: #111827;
            font-size: 2rem;
        }

    .features-header p {
        color: #78909c;
        font-size: 1.0625rem;
        line-height: 1.5;
        margin: 0;
    }

/* Grid de características */
.features-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.feature-card {
    background: #ffffff;
    padding: 1.375rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

    .feature-card:hover {
        transform: translateY(-4px) translateX(4px);
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
        border-color: #111827;
    }

.feature-icon-wrapper {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #111827 0%, #374151 50%, #1f2937 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 20px rgba(156, 39, 176, 0.25);
}

.feature-icon {
    color: #ffffff;
    font-size: 1.375rem;
}

.feature-content {
    flex: 1;
    min-width: 0;
}

.feature-title {
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.feature-description {
    color: #78909c;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

/* ========================================
   SUCCESS OVERLAY
   Clase JS: is-active
   ======================================== */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .success-overlay.is-active {
        display: flex;
        opacity: 1;
        visibility: visible;
    }

.success-modal {
    background: #ffffff;
    padding: 3rem 3.5rem;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    transform: scale(0.85);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 90%;
    width: 420px;
}

.success-overlay.is-active .success-modal {
    transform: scale(1);
}

.success-icon-wrapper {
    width: 88px;
    height: 88px;
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 12px 35px rgba(76, 175, 80, 0.4);
    animation: successPop 0.5s ease 0.2s both;
}

@keyframes successPop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.success-icon {
    color: #ffffff;
    font-size: 2.5rem;
}

.success-title {
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    font-size: 1.875rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.success-message {
    color: #78909c;
    font-size: 1.0625rem;
    margin: 0;
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */
@media (max-width: 1100px) {
    .login-page {
        padding: 1rem;
    }

    .login-container {
        min-height: auto;
    }

    .login-form-column,
    .features-column {
        padding: 2.5rem 2rem;
    }
}

/* ========================================
   RESPONSIVE - UNA COLUMNA
   ======================================== */
@media (max-width: 900px) {
    .login-content {
        grid-template-columns: 1fr;
    }

    .features-column {
        border-left: none;
        border-top: 1px solid #f0f0f0;
        order: 2;
    }

    .login-form-column {
        order: 1;
    }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */
@media (max-width: 600px) {
    .login-page {
        padding: 0.75rem;
        align-items: flex-start;
        padding-top: 1rem;
    }

    .login-container {
        border-radius: 20px;
    }

    .login-breadcrumb {
        padding: 0.875rem 1.25rem;
    }

    .breadcrumb {
        font-size: 0.8125rem;
    }

    .login-form-column,
    .features-column {
        padding: 1.75rem 1.5rem;
    }

    .form-header h1 {
        font-size: 1.75rem;
        flex-direction: column;
        gap: 0.5rem;
    }

        .form-header h1 i {
            font-size: 2rem;
        }

    .features-header h2 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .social-login {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .feature-card {
        padding: 1.125rem 1.25rem;
    }

    .feature-icon-wrapper {
        width: 48px;
        height: 48px;
    }

    .feature-icon {
        font-size: 1.125rem;
    }

    .feature-title {
        font-size: 1rem;
    }

    .feature-description {
        font-size: 0.8125rem;
    }

    .success-modal {
        padding: 2.5rem 2rem;
    }
}

/* ========================================
   UTILIDADES
   ======================================== */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.is-hidden {
    display: none !important;
}

/* ========================================
   ANIMACIONES DE ENTRADA
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-25px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

.login-form-column {
    animation: fadeInUp 0.5s ease-out;
}

.features-column {
    animation: fadeInRight 0.5s ease-out 0.15s both;
}

.feature-card {
    animation: fadeInUp 0.4s ease-out both;
}

    .feature-card:nth-child(1) {
        animation-delay: 0.25s;
    }

    .feature-card:nth-child(2) {
        animation-delay: 0.35s;
    }

    .feature-card:nth-child(3) {
        animation-delay: 0.45s;
    }

    .feature-card:nth-child(4) {
        animation-delay: 0.55s;
    }

/* Spinner */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.fa-spin {
    animation: spin 1s linear infinite;
}
