:root {
    --primary: #6a1b9a;
    --primary-light: #9c4dcc;
    --primary-dark: #38006b;
    --secondary: #e1bee7;
    --accent: #ff4081;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    min-height: 100vh;
    padding: 1rem; /* Añadido para dar espacio en pantallas pequeñas */
}

.login-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 448px; /* max-w-md */
    padding: 2rem;
}

.tab-button {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 1rem; /* Tamaño base */
}

.tab-button.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(106, 27, 154, 0.3);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #f9fafb;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(106, 27, 154, 0.1);
}

.form-input.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(106, 27, 154, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(106, 27, 154, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-google {
    width: 100%;
    background: white;
    color: #374151;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-google:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: #6b7280;
    font-size: 14px;
}

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

.divider span {
    padding: 0 16px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox.checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkbox.checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label {
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
    cursor: pointer;
}

.checkbox-label a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

.captcha-container {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.captcha-code {
    background: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--primary);
    border: 1px solid #d1d5db;
    user-select: none;
}

.captcha-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
}

.captcha-refresh {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.captcha-refresh:hover {
    background: var(--primary-light);
}

.error-message {
    color: #ef4444;
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.success-message {
    color: #10b981;
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.form-section {
    display: none;
}

.form-section.active {
    display: block;
}

.logo {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.forgot-password {
    text-align: center;
    margin-top: 16px;
}

.forgot-password a {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.forgot-password a:hover {
    text-decoration: underline;
}

.password-strength {
    margin-top: 8px;
    font-size: 12px;
}

.strength-weak {
    color: #ef4444;
}

.strength-medium {
    color: #f59e0b;
}

.strength-strong {
    color: #10b981;
}

/* ---------------------------------- */
/* --- Media Queries (Responsive) --- */
/* ---------------------------------- */

/* Para tabletas y dispositivos más pequeños (hasta 768px) */
@media (max-width: 768px) {
    .login-container {
        padding: 1.5rem;
    }

    h1 { /* Usando h1 para seleccionar el título principal */
        font-size: 1.5rem; /* 24px */
    }
}

/* Para teléfonos móviles (hasta 480px) */
@media (max-width: 480px) {
    body {
        padding: 0.5rem; /* Menos padding en pantallas muy pequeñas */
        display: block; /* Permite scroll si el contenido es muy alto */
    }

    .login-container {
        padding: 1rem;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    h1 {
        font-size: 1.25rem; /* 20px */
    }
    
    .tab-button {
        padding: 10px 12px;
        font-size: 0.875rem; /* 14px */
    }

    .btn-google, .btn-primary {
        padding: 12px 16px;
        font-size: 0.9rem; /* Un poco más pequeño */
    }

    .captcha-container {
        flex-wrap: wrap; /* Permite que los elementos se envuelvan */
        gap: 8px;
    }

    .captcha-code {
        font-size: 16px;
        padding: 6px 10px;
    }

    .captcha-input {
        width: 100%; /* Ocupa todo el ancho disponible */
        flex: auto;
        order: 3; /* Cambia el orden para que aparezca al final */
    }
    
    .captcha-refresh {
        order: 2; /* Pone el botón de refrescar antes del input */
    }
    
    .checkbox-label {
        font-size: 12px; /* Reduce el tamaño del texto de los checkboxes */
    }
}