/* Overlay y Card Principal */
.modal-overlay {
    position: fixed;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    z-index: 10000;
}

/* Ajuste en la Card */
.login-modal-card {
    background: #ffffff;
    width: 92%;
    max-width: 440px;
    padding: 50px 40px;
    border-radius: 24px;
    position: relative;
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
    font-family: 'Inter', -apple-system, sans-serif;
    
    /* Eliminamos transiciones de altura que puedan bugear el renderizado inicial */
    margin-top: auto;
    margin-bottom: auto;
}
/* Títulos estilo Webtoon */
.modal-header h2 {
    margin: 0 0 30px;
    font-size: 22px;
    color: #111;
    text-align: center;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Campos de entrada refinados */
.input-group { margin-bottom: 20px; }

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.input-group input {
    width: 100%;
    padding: 12px 0; /* Estilo minimalista */
    border: none;
    border-bottom: 1px solid #ddd;
    border-radius: 0;
    font-size: 15px;
    transition: border-color 0.3s;
    outline: none;
}

.input-group input:focus {
    border-bottom: 2px solid #00e561; /* Verde Webtoon */
}

/* Botones de acción (Grid de 2 columnas) */
.modal-actions {
    display: grid;
    margin-top: 35px;
}

.btn-back {
    background: #e5e5e5;
    color: #111;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.submit-btn {
    background: #00e561; /* El verde vibrante de la imagen */
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.submit-btn:hover { opacity: 0.9; }

/* Lógica de cambio Login / Registro */
#register-fields { display: none; }

.mode-register #register-fields { display: block; }
.mode-register #login-title { display: none; }
.mode-register #register-title { display: block; }
#register-title { display: none; }

/* Footer links */
.modal-footer-info {
    margin-top: 30px;
    text-align: center;
    font-size: 13px;
    color: #888;
}

.modal-footer-info a {
    color: #666;
    text-decoration: underline;
    font-weight: 500;
    margin: 0 5px;
}

/* Botón cerrar */
.close-modal {
    position: absolute;
    top: 20px; right: 20px;
    background: none; border: none;
    font-size: 24px; color: #999;
    cursor: pointer;
    line-height: 1;
}

/* Animaciones */
@keyframes modalSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.login-modal-card { animation: modalSlideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); }