@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

:root {
    --color-green: #00ff73;
    --color-purple: #9400d3;
    --color-white: #ffffff;
    --color-black: #333333;
    --color-blue: #0077ff;
    --color-red: #ff3b3b;
    --color-gray: #f5f5f5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

body {
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--color-purple), var(--color-green));
    overflow: hidden;
    position: relative;
    padding: 20px;
}

/* Contenedor ECG */
.ecg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.ecg-container svg {
    width: 100%;
    height: 100%;
}

.ecg-line {
    stroke: var(--color-white);
    stroke-width: 2.5;
    stroke-dasharray: 1500;
    stroke-linecap: round;
    fill: none;
    filter: drop-shadow(0 0 12px var(--color-white));
    animation: ecg-draw 3s linear infinite, ecg-glow 2s ease-in-out infinite;
}

@keyframes ecg-draw {
    0% { stroke-dashoffset: 1500; }
    100% { stroke-dashoffset: 0; }
}

@keyframes ecg-glow {
    0%, 50% { filter: drop-shadow(0 0 12px var(--color-white)); }
    100% { filter: drop-shadow(0 0 30px var(--color-white)); }
}

/* Contenedor Login */
.login-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    z-index: 2;
    position: relative;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
    color: var(--color-white);
}

.login-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.login-header p {
    font-size: 16px;
    opacity: 0.9;
}

.logo-container {
    margin-bottom: 25px;
}

.login-logo {
    height: 90px;
    width: auto;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.7));
    transition: transform 0.3s ease;
}

.login-logo:hover {
    transform: scale(1.05);
}

/* Formulario */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group {
    position: relative;
    margin-bottom: 15px;
}

.input-group input {
    width: 100%;
    padding: 15px 20px 15px 45px;
    border: none;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-white);
    font-size: 16px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.input-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-white);
    font-size: 20px;
    opacity: 0.8;
}

/* Términos y condiciones */
.terms-checkbox {
    display: flex;
    align-items: center;
    margin: 15px 0;
    color: var(--color-white);
    font-size: 14px;
}

.terms-checkbox input {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    accent-color: var(--color-green);
    cursor: pointer;
}

.terms-checkbox label {
    cursor: pointer;
}

.terms-checkbox a {
    color: var(--color-green);
    text-decoration: none;
    font-weight: 600;
    margin-left: 3px;
    transition: all 0.2s ease;
}

.terms-checkbox a:hover {
    text-decoration: underline;
    text-shadow: 0 0 8px rgba(0, 255, 115, 0.5);
}

/* Botones */
.submit-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 30px;
    background: var(--color-green);
    color: var(--color-black);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: #00e66a;
}

.submit-btn span {
    display: inline-block;
}

/* Google Login */
.google {
    margin-top: 20px;
}

.google a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 30px;
    background: var(--color-white);
    color: var(--color-black);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.google a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background: #f1f1f1;
}

.google a img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border-radius: 50%;
}

/* Enlaces */
.links {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.links a {
    color: var(--color-white);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    min-width: max-content;
}

.links a:hover {
    text-decoration: underline;
    color: var(--color-green);
}

/* Loader */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loader-container.show {
    opacity: 1;
    visibility: visible;
}

.loader {
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid var(--color-green);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal */
#legal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--color-white);
    padding: 30px;
    border-radius: 15px;
    width: 100%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--color-green);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--color-purple);
    transition: all 0.3s ease;
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: var(--color-red);
    transform: rotate(90deg);
}

#modal-body {
    padding: 10px 0;
}

#modal-body h2 {
    color: var(--color-purple);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-green);
}

#modal-body p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: var(--color-black);
}

/* Mensajes de error */
.error-message {
    color: var(--color-red);
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 14px;
    border-left: 3px solid var(--color-red);
}

/* Responsive */
@media (max-width: 768px) {
    .login-container {
        padding: 30px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .login-logo {
        height: 80px;
    }
    
    .input-group input {
        padding: 12px 15px 12px 40px;
        font-size: 15px;
    }
    
    .input-group i {
        font-size: 18px;
    }
    
    .terms-checkbox {
        font-size: 13px;
    }
    
    .links {
        flex-direction: column;
        gap: 10px;
    }
    
    .links a {
        text-align: center;
    }
    
    .modal-content {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .login-container {
        padding: 25px 20px;
    }
    
    .login-header h1 {
        font-size: 22px;
    }
    
    .login-logo {
        height: 70px;
    }
    
    .input-group input {
        padding: 12px 15px 12px 38px;
    }
    
    .submit-btn, .google a {
        padding: 12px;
        font-size: 15px;
    }
    
    .google a img {
        width: 18px;
        height: 18px;
    }
}