/* ========================================
   MODAL - DISEÑO MODERNO
   ======================================== */

/* Modal Base - Fondo oscuro semitransparente */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(45, 55, 72, 0.85);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Content - Contenedor blanco */
.modal-content {
    position: relative;
    width: 90%;
    max-width: 480px;
    background: #ffffff;
    border-radius: 16px;
    padding: 3rem 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2001;
}

.modal.active .modal-content {
    transform: scale(1);
}

/* Botón de Cerrar */
.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: transparent;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 3;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #1a202c;
}

.modal-close svg {
    width: 24px;
    height: 24px;
}

/* Cuerpo del Modal */
.modal-body {
    position: relative;
}

/* Títulos */
.modal-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.modal-subtitle {
    font-size: 1rem;
    color: #718096;
    margin-bottom: 2rem;
    font-weight: 400;
}

/* Formulario de Inicio de Sesión */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Grupos de Formulario */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label::before {
    font-size: 1.1rem;
}

/* Contenedor de Input para iconos */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
}

/* Entradas */
.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"] {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: #1a202c;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}

.login-form input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-form input::placeholder {
    color: #a0aec0;
}

/* Alternar Contraseña */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #718096;
}

.password-toggle .eye-icon {
    width: 20px;
    height: 20px;
}

/* Fila de Casilla de Verificación + Olvidó Contraseña */
.form-row-remember {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -0.5rem 0 0.5rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #6366f1;
}

.checkbox-wrapper label {
    font-size: 0.9rem;
    color: #1a202c;
    cursor: pointer;
    font-weight: 500;
}

.forgot-link {
    font-size: 0.9rem;
    color: #d69e2e;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

/* Botón Primario */
.btn-primary {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: #6366f1;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-body);
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Botón de Google */
.btn-google {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-family: var(--font-body);
}

.btn-google:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

/* Texto de Cambio de Autenticación */
.auth-switch {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.95rem;
    color: #718096;
}

.auth-switch a {
    color: #6366f1;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-switch a:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* Enlace de Reenvío de Correo */
.resend-link {
    display: block;
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #718096;
}

.resend-link a {
    color: #d69e2e;
    text-decoration: none;
    font-weight: 500;
}

.resend-link a:hover {
    color: #b7791f;
    text-decoration: underline;
}

/* Divisor */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: #a0aec0;
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.divider span {
    padding: 0 0.75rem;
}

/* Mensajes de Error/Éxito */
.login-error,
.login-success {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.login-error {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.login-success {
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

/* ========================================
   RESPONSIVE DESIGN - MODAL
   ======================================== */

/* Tablets (768px) */
@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        max-width: 450px;
        padding: 2.5rem 2rem;
    }

    .modal-title {
        font-size: 1.875rem;
    }

    .modal-subtitle {
        font-size: 0.975rem;
    }

    .login-form input[type="text"],
    .login-form input[type="email"],
    .login-form input[type="password"] {
        padding: 0.825rem 0.95rem;
        font-size: 0.975rem;
    }

    .btn-primary {
        padding: 0.95rem 1.35rem;
        font-size: 0.975rem;
    }
}

/* Móviles Grandes (640px) */
@media (max-width: 640px) {
    .modal-content {
        padding: 2rem 1.5rem;
        width: 92%;
    }

    .modal-title {
        font-size: 1.75rem;
    }

    .modal-subtitle {
        font-size: 0.95rem;
    }

    .form-row-remember {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .login-form input[type="text"],
    .login-form input[type="email"],
    .login-form input[type="password"] {
        padding: 0.8rem 0.9rem;
        font-size: 0.95rem;
    }

    .btn-primary {
        padding: 0.9rem 1.25rem;
        font-size: 0.95rem;
    }

    .password-toggle .eye-icon {
        width: 19px;
        height: 19px;
    }
}

/* Móviles Estándar (480px) */
@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        padding: 1.75rem 1.35rem;
    }

    .modal-title {
        font-size: 1.65rem;
    }

    .modal-subtitle {
        font-size: 0.925rem;
    }

    .login-form {
        gap: 1.35rem;
    }

    .form-group {
        gap: 0.45rem;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .login-form input[type="text"],
    .login-form input[type="email"],
    .login-form input[type="password"] {
        padding: 0.775rem 0.875rem;
        font-size: 0.925rem;
    }

    .btn-primary {
        padding: 0.875rem 1.2rem;
        font-size: 0.925rem;
    }

    .btn-google {
        padding: 0.875rem 1.2rem;
        font-size: 0.925rem;
    }

    .auth-switch {
        font-size: 0.925rem;
    }

    .forgot-link {
        font-size: 0.875rem;
    }

    .checkbox-wrapper label {
        font-size: 0.875rem;
    }
}

/* Móviles Compactos (414px) */
@media (max-width: 414px) {
    .modal-content {
        width: 96%;
        padding: 1.65rem 1.25rem;
    }

    .modal-title {
        font-size: 1.55rem;
    }

    .modal-subtitle {
        font-size: 0.9rem;
    }

    .login-form {
        gap: 1.25rem;
    }

    .login-form input[type="text"],
    .login-form input[type="email"],
    .login-form input[type="password"] {
        padding: 0.75rem 0.85rem;
        font-size: 0.9rem;
    }

    .btn-primary {
        padding: 0.85rem 1.15rem;
        font-size: 0.9rem;
    }
}

/* Móviles Pequeños (375px) */
@media (max-width: 375px) {
    .modal-content {
        width: 97%;
        padding: 1.5rem 1.15rem;
    }

    .modal-title {
        font-size: 1.45rem;
    }

    .modal-subtitle {
        font-size: 0.875rem;
    }

    .login-form {
        gap: 1.15rem;
    }

    .form-group label {
        font-size: 0.875rem;
    }

    .login-form input[type="text"],
    .login-form input[type="email"],
    .login-form input[type="password"] {
        padding: 0.725rem 0.825rem;
        font-size: 0.875rem;
    }

    .btn-primary {
        padding: 0.825rem 1.1rem;
        font-size: 0.875rem;
    }

    .auth-switch {
        font-size: 0.9rem;
    }
}

/* Móviles Muy Pequeños (360px) */
@media (max-width: 360px) {
    .modal-content {
        width: 98%;
        padding: 1.4rem 1.1rem;
    }

    .modal-title {
        font-size: 1.375rem;
    }

    .modal-subtitle {
        font-size: 0.85rem;
    }

    .login-form {
        gap: 1.1rem;
    }

    .form-group {
        gap: 0.4rem;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .login-form input[type="text"],
    .login-form input[type="email"],
    .login-form input[type="password"] {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
    }

    .btn-primary {
        padding: 0.8rem 1.05rem;
        font-size: 0.85rem;
    }

    .checkbox-wrapper input[type="checkbox"] {
        width: 17px;
        height: 17px;
    }
}

/* Wearables / Smartwatches (320px) */
@media (max-width: 320px) {
    .modal-content {
        width: 99%;
        padding: 1.25rem 1rem;
    }

    .modal-title {
        font-size: 1.3rem;
    }

    .modal-subtitle {
        font-size: 0.825rem;
    }

    .login-form {
        gap: 1rem;
    }

    .form-group {
        gap: 0.375rem;
    }

    .form-group label {
        font-size: 0.825rem;
    }

    .login-form input[type="text"],
    .login-form input[type="email"],
    .login-form input[type="password"] {
        padding: 0.675rem 0.775rem;
        font-size: 0.825rem;
    }

    .btn-primary {
        padding: 0.775rem 1rem;
        font-size: 0.825rem;
    }

    .btn-google {
        padding: 0.75rem 1rem;
        font-size: 0.825rem;
    }

    .auth-switch {
        font-size: 0.875rem;
    }

    .forgot-link {
        font-size: 0.825rem;
    }

    .checkbox-wrapper label {
        font-size: 0.825rem;
    }

    .password-toggle .eye-icon {
        width: 17px;
        height: 17px;
    }
}