﻿/* =========================================
   GENERAL STYLES (Unificados y Seguros)
   ========================================= */
html, body {
    font-family: 'Arial', sans-serif;
    background-color: #F4F8F9;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* =========================================
   CONTENEDORES PRINCIPALES (Login y Registro)
   ========================================= */
.login-container,
.register-container {
    flex: 1; /* Permite que el contenedor ocupe el alto disponible */
    display: flex;
    justify-content: center;
    align-items: center; /* Centrado vertical en PC */
    padding: 20px 0;
    padding-bottom: 70px; /* Margen para que no choque con el footer fijo en PC */
}

/* =========================================
   TARJETAS (Login y Registro)
   ========================================= */
.login-card,
.register-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2.5rem;
    width: 90%;
    text-align: center;
    margin: auto;
}

.login-card {
    max-width: 400px;
}

.register-card {
    max-width: 800px;
}

.login-header img,
.register-header img {
    margin-bottom: 1rem;
}

/* =========================================
   FORMULARIOS
   ========================================= */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        color: #333;
        font-weight: bold;
    }

    .form-group input {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid #ddd;
        border-radius: 8px;
        font-size: 1rem;
        outline: none;
        transition: border-color 0.3s ease, box-shadow 0.3s ease;
        box-sizing: border-box;
    }

        .form-group input:focus {
            border-color: #4B0082;
            box-shadow: 0 0 5px rgba(75, 0, 130, 0.5);
        }

/* =========================================
   BOTONES Y ENLACES
   ========================================= */
.btn-login,
.btn-register {
    display: block;
    width: 100%;
    background-color: #F84F59;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

    .btn-login:hover,
    .btn-register:hover {
        background-color: #FA848B;
    }

hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 1.5rem 0;
}

.forgot-password a,
.register-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

    .forgot-password a:hover,
    .register-link a:hover {
        text-decoration: underline;
    }

/* =========================================
   FOOTER (Comportamiento Adaptable)
   ========================================= */
.footer {
    background-color: #f8f9fa;
    text-align: center;
    padding: 10px;
    width: 100%;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* =========================================
   ELEMENTOS DE FEEDBACK (Mensajes y Spinner)
   ========================================= */
.success-message {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 15px;
    border-radius: 8px;
    font-size: 1rem;
    margin: 0 auto 20px auto;
    max-width: 100%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4B0082;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* =========================================
   MEDIA QUERIES (Ajustes para móviles y escritorio)
   ========================================= */

/* ESCRITORIO: Footer fijo abajo */
@media (min-width: 768px) {
    .footer {
        position: fixed;
        bottom: 0;
        left: 0;
    }
}

/* MÓVILES: Comportamiento de Scroll */
@media (max-width: 767.98px) {
    .login-container,
    .register-container {
        align-items: flex-start; /* Evita que se corte la parte superior al abrir el teclado */
        padding: 20px 10px;
    }

    .login-card,
    .register-card {
        padding: 1.5rem;
        width: 95%;
    }

    .footer {
        position: static; /* El footer deja de ser fijo y se va al final del documento */
        margin-top: auto;
    }
}
