/* Variables y Configuración Base (Estilo Azul Google/ERP Limpio) */
:root {
    --bg-gradient-start: #f8f9fa;
    --bg-gradient-end: #e8f0fe;
    --primary-color: #1a73e8;
    --primary-hover: #1557b0;
    --text-main: #202124;
    --text-muted: #5f6368;
    --input-bg: rgba(255, 255, 255, 0.9);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(218, 220, 224, 0.8);
    --error-color: #d32f2f;
    --success-color: #188038;
    --whatsapp-color: #25D366;
    --whatsapp-hover: #1EBE5D;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.hidden-field {
    display: none !important;
}

.hidden {
    display: none !important;
}

/* Layout Principal */
.main-wrapper {
    width: 100%;
    max-width: 1200px;
    min-height: 85vh;
    background: var(--glass-bg);
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    display: flex;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Panel Izquierdo (Formulario) */
.form-panel {
    flex: 1;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.logo {
    position: absolute;
    top: 40px;
    left: 60px;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--primary-color);
    border: 1px solid var(--glass-border);
    padding: 5px 15px;
    border-radius: 20px;
    background: white;
}

.form-container h2 {
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 10px;
    font-weight: 500;
}

.form-container p {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

/* Inputs y Botones */
.input-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    padding: 15px 20px;
    border-radius: 25px;
    border: 1px solid var(--glass-border);
    background: var(--input-bg);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

textarea {
    border-radius: 15px;
    resize: none;
}

input:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    border-radius: 25px;
    border: none;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
    margin-top: 10px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.btn-whatsapp {
    background: var(--whatsapp-color);
}

.btn-whatsapp:hover {
    background: var(--whatsapp-hover);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* Enlaces del Footer */
.form-footer {
    margin-top: 10px;
    text-align: center;
    font-size: 0.9rem;
    padding-bottom: 20px;
}

.link-btn {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.link-btn:hover {
    text-decoration: underline;
}

.legal-links {
    margin-top: 15px;
}

.link-btn-small {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.link-btn-small:hover {
    color: var(--text-main);
    text-decoration: underline;
}

/* Separador y Botones Sociales */
.divider-container {
    text-align: center;
    margin: 30px 0 20px 0;
    position: relative;
}

.divider-line {
    border: 0;
    border-top: 1px solid var(--glass-border);
    position: absolute;
    top: 50%;
    width: 100%;
    z-index: 1;
}

.divider-text {
    background: var(--bg-gradient-start);
    padding: 0 15px;
    position: relative;
    z-index: 2;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-radius: 10px;
}

.social-login-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.social-btn {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.social-btn svg {
    width: 20px;
    height: 20px;
}

/* Panel Derecho (Imagen) */
.image-panel {
    flex: 1.2;
    background-size: cover;
    background-position: center;
    position: relative;
}

.glass-overlay {
    position: absolute;
    bottom: 40px;
    left: 40px;
    right: 40px;
    background: rgba(255, 255, 255, 0.85);
    padding: 25px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.overlay-text h3 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-weight: 600;
}

.overlay-text p {
    color: var(--text-main);
    font-size: 0.95rem;
}

/* Modales */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(32, 33, 36, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 800px;
    border-radius: 30px;
    padding: 40px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--error-color);
}

.terms-scroll-area {
    max-height: 350px;
    overflow-y: auto;
    margin-top: 20px;
    padding-right: 15px;
    text-align: justify;
}

.terms-scroll-area h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    margin-top: 15px;
    color: var(--text-main);
}

.terms-scroll-area p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    line-height: 1.6;
}

.grid-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
    margin-top: 20px;
}

.full-width {
    grid-column: 1 / -1;
}

/* Loader y Alertas */
.loader {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    position: absolute;
}

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

.alert {
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.alert-error {
    background: rgba(211, 47, 47, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(211, 47, 47, 0.3);
}

.alert-success {
    background: rgba(24, 128, 56, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(24, 128, 56, 0.3);
}

/* Responsive - Celulares y Tablets */
@media (max-width: 900px) {
    .main-wrapper {
        flex-direction: column;
        min-height: auto;
        border-radius: 20px;
    }
    
    .image-panel {
        display: none;
    }
    
    .form-panel {
        padding: 40px 20px;
    }
    
    .logo {
        position: static;
        margin-bottom: 30px;
        display: inline-block;
        width: fit-content;
    }
    
    .grid-form {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
    
    .close-modal {
        top: 15px;
        right: 15px;
    }
}