/* =================================================================
   ENDO LEADERS GEST - ESTILOS UNIFICADOS DE FORMULARIOS
   Archivo CSS centralizado para formularios de registro y actualización
   ================================================================= */

/* Variables CSS */
:root {
    --elg-primary-color: #1e40af;
    --elg-primary-hover: #1d4ed8;
    --elg-secondary-color: #3b82f6;
    --elg-success-color: #10b981;
    --elg-danger-color: #ef4444;
    --elg-warning-color: #f59e0b;
    --elg-text-primary: #1f2937;
    --elg-text-secondary: #6b7280;
    --elg-gray-100: #f3f4f6;
    --elg-gray-200: #e5e7eb;
    --elg-gray-300: #d1d5db;
    --elg-gray-400: #9ca3af;
    --elg-gray-500: #6b7280;
    --elg-gray-600: #4b5563;
    --elg-gray-700: #374151;
    --elg-gray-800: #1f2937;
    --elg-gray-900: #111827;
    --elg-bg-light: #f8fafc;
    --elg-border-color: #e2e8f0;
    --elg-border-radius: 12px;
    --elg-transition: all 0.3s ease;
    --elg-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --elg-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --elg-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --elg-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* =================================================================
   CONTENEDORES PRINCIPALES
   ================================================================= */

.elg-modern-form {
    max-width: 1200px;
    margin: 2rem auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, var(--elg-bg-light) 0%, #ffffff 100%);
    border-radius: var(--elg-border-radius);
    overflow: hidden;
    box-shadow: var(--elg-shadow-xl);
    position: relative;
}

.elg-form-container {
    background: white;
    border-radius: var(--elg-border-radius);
    overflow: hidden;
    box-shadow: var(--elg-shadow-md);
    border: 1px solid var(--elg-gray-200);
}

.elg-form-wrapper {
    padding: 0;
}

.elg-unified-form {
    padding: 0;
}

/* =================================================================
   LAYOUT DE COLUMNAS PRINCIPAL
   ================================================================= */

.elg-main-columns {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    padding: 1.5rem;
}

.elg-column {
    display: flex;
    flex-direction: column;
}

.elg-photo-column {
    border-right: 1px solid var(--elg-border-color);
    padding-right: 1.5rem;
}

.elg-data-column {
    padding-left: 1rem;
}

/* =================================================================
   TÍTULOS Y SECCIONES
   ================================================================= */

.elg-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--elg-text-primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--elg-border-color);
}

.elg-icon {
    color: var(--elg-primary-color);
}

.elg-legal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--elg-text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* =================================================================
   GRID DE FORMULARIO Y CAMPOS
   ================================================================= */

.elg-form-grid {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 1fr;
}

.elg-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.elg-seccion-legal .elg-field-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.elg-half-width {
    grid-column: span 1;
}

.elg-full-width {
    grid-column: span 2;
}

.elg-input-wrapper {
    position: relative;
}

.elg-textarea-wrapper {
    position: relative;
}

.elg-field-note {
    font-size: 0.875rem;
    color: var(--elg-gray-600);
    margin-top: 0.5rem;
}

.elg-char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: var(--elg-gray-600);
    margin-top: 0.5rem;
}

/* =================================================================
   INPUTS Y CONTROLES DE FORMULARIO
   ================================================================= */

.elg-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--elg-gray-700);
    margin-bottom: 0.5rem;
    display: block;
}

.elg-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--elg-gray-300);
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--elg-text-primary);
    background-color: white;
    transition: var(--elg-transition);
    outline: none;
}

.elg-input:focus {
    border-color: var(--elg-primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.elg-input:disabled,
.elg-input[readonly] {
    background-color: var(--elg-gray-100);
    color: var(--elg-gray-500);
    cursor: not-allowed;
}

.elg-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--elg-gray-300);
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--elg-text-primary);
    background-color: white;
    transition: var(--elg-transition);
    outline: none;
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.elg-textarea:focus {
    border-color: var(--elg-primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.elg-input-underline,
.elg-textarea-underline {
    display: none;
}

/* =================================================================
   SUBIDA DE FOTOS
   ================================================================= */

.elg-photo-upload-area {
    border: 2px dashed var(--elg-border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    background: var(--elg-bg-light);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.elg-photo-upload-area:hover {
    border-color: var(--elg-primary-color);
    background: rgba(59, 130, 246, 0.05);
}

.elg-photo-upload-area.drag-over {
    border-color: var(--elg-primary-color);
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.02);
}

.elg-photo-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.elg-photo-preview {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: var(--elg-shadow-md);
    margin-bottom: 1rem;
}

.elg-photo-icon {
    color: var(--elg-gray-400);
    margin-bottom: 1rem;
}

.elg-upload-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--elg-text-primary);
    margin-bottom: 0.5rem;
}

.elg-upload-subtext {
    font-size: 0.875rem;
    color: var(--elg-gray-500);
    margin-bottom: 1rem;
}

.elg-file-input {
    display: none !important;
}

.elg-photo-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

/* =================================================================
   BOTONES
   ================================================================= */

.elg-btn-primary {
    background: var(--elg-primary-color);
    color: #fff;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
    justify-content: center;
}

.elg-btn-primary:hover:not(:disabled) {
    background: var(--elg-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--elg-shadow-lg);
}

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

.elg-btn-secondary {
    background: white;
    color: var(--elg-primary-color);
    border: 2px solid var(--elg-primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--elg-transition);
}

.elg-btn-secondary:hover {
    background: var(--elg-primary-color);
    color: white;
    transform: translateY(-1px);
}

.elg-btn-danger {
    background: var(--elg-danger-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--elg-transition);
}

.elg-btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.elg-btn-text,
.elg-btn-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* =================================================================
   SECCIÓN LEGAL
   ================================================================= */

.elg-seccion-legal {
    background: var(--elg-bg-light);
    padding: 1.5rem;
    border-top: 1px solid var(--elg-border-color);
}

.elg-clausula {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--elg-border-color);
}

.elg-clausula:hover {
    border-color: var(--elg-primary-color);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.1);
}

.elg-clausula input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--elg-primary-color);
}

.elg-clausula label {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.3;
    color: var(--elg-text-primary);
    cursor: pointer;
}

.elg-clausula a {
    color: var(--elg-primary-color);
    text-decoration: none;
}

.elg-clausula a:hover {
    text-decoration: underline;
}

.elg-aviso-proteccion {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 4px;
}

.elg-aviso-proteccion-compact {
    font-size: 0.7em;
    color: #666;
    margin-bottom: 15px;
    padding: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    line-height: 1.3;
}

/* =================================================================
   ACCIONES DEL FORMULARIO
   ================================================================= */

.elg-form-actions {
    text-align: center;
    margin-top: 1rem;
}

/* =================================================================
   MENSAJES Y NOTIFICACIONES
   ================================================================= */

.elg-message {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid;
}

.elg-message.success {
    background-color: #ecfdf5;
    border-color: #10b981;
    color: #047857;
}

.elg-message.error {
    background-color: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
}

.elg-spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--elg-primary-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 2s linear infinite;
}

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

/* =================================================================
   CLASES UTILITARIAS
   ================================================================= */

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

.elg-photo-preview-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: var(--elg-shadow-md);
}

.elg-photo-info {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--elg-gray-600);
}

.elg-success-modal {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: var(--elg-border-radius);
    box-shadow: var(--elg-shadow-lg);
}

.elg-success-icon {
    margin-bottom: 1rem;
}

.elg-success-title {
    color: var(--elg-success-color);
    margin-bottom: 1rem;
}

.elg-success-text {
    color: var(--elg-gray-600);
    margin-bottom: 2rem;
}

.elg-spinner-centered {
    margin: 0 auto;
}

.elg-avatar-rounded {
    border-radius: 50%;
    object-fit: cover;
}

/* =================================================================
   RESPONSIVE DESIGN
   ================================================================= */

@media (min-width: 768px) {
    .elg-form-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .elg-half-width {
        grid-column: span 1;
    }

    .elg-full-width {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .elg-modern-form {
        margin: 1rem;
        border-radius: 0;
    }

    .elg-main-columns {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .elg-photo-column {
        border-right: none;
        padding-right: 0;
        padding-top: 0;
        border-bottom: 1px solid var(--elg-border-color);
        padding-bottom: 1.5rem;
    }

    .elg-data-column {
        padding-left: 0;
        padding-top: 1.5rem;
    }

    .elg-form-container {
        padding: 1.5rem;
    }

    .elg-form-header {
        padding: 1.5rem;
    }
    
    .elg-seccion-legal,
    .elg-form-actions {
        padding: 1.5rem;
    }

    .elg-photo-upload-area {
        min-height: 200px;
    }

    .elg-photo-preview {
        width: 150px;
        height: 150px;
    }

    .elg-half-width,
    .elg-full-width {
        grid-column: span 2;
    }

    .elg-btn-primary {
        width: 100%;
        max-width: 300px;
    }
}

/* =================================================================
   TOGGLE SWITCHES (moved from inline styles)
   ================================================================= */
.elg-switches{
    display:flex;
    flex-direction:column;
    gap:12px;
    margin-top:12px;
}
.elg-switch-item{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:8px 0;
}
.elg-switch{
    position:relative;
    width:46px;
    height:26px;
}
.elg-switch input{
    opacity:0;
    /* keep input covering the slider area so clicks reach it */
    width:46px;
    height:26px;
    position:absolute;
    left:0;
    top:0;
    margin:0;
    cursor:pointer;
}
.elg-switch-slider{
    position:absolute;
    cursor:pointer;
    top:0;
    left:0;
    right:0;
    bottom:0;
    background:#ddd;
    transition:.28s;
    border-radius:26px;
}
.elg-switch-slider:before{
    position:absolute;
    content:"";
    height:20px;
    width:20px;
    left:3px;
    bottom:3px;
    background:#fff;
    transition:.28s;
    border-radius:50%;
}
.elg-switch input:checked + .elg-switch-slider{
    background:var(--elg-primary-color,#0073aa);
}
.elg-switch input:checked + .elg-switch-slider:before{
    transform:translateX(20px);
}
.elg-switch label{margin-right:8px}
.elg-field-note{font-size:.85rem;color:#6b7280}

/* =================================================================
   ACCESS BLOCKED PAGE
   ================================================================= */

.elg-blocked-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 3rem 1rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.elg-blocked-card {
    text-align: center;
    max-width: 480px;
    width: 100%;
    background: #fff;
    border: 1px solid var(--elg-gray-200, #e5e7eb);
    border-top: 4px solid var(--elg-primary-color, #1e40af);
    border-radius: 12px;
    padding: 3rem 2.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
}

.elg-blocked-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 1.25rem;
}

.elg-blocked-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--elg-text-primary, #1f2937);
    margin: 0 0 1rem;
}

.elg-blocked-message {
    font-size: 1rem;
    color: var(--elg-text-secondary, #6b7280);
    line-height: 1.6;
    margin: 0 0 2rem;
}

.elg-blocked-btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: var(--elg-primary-color, #1e40af);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.elg-blocked-btn:hover {
    background: var(--elg-primary-hover, #1d4ed8);
    color: #fff;
    transform: translateY(-1px);
    text-decoration: none;
}

@media (max-width: 640px) {
    .elg-blocked-card {
        padding: 2rem 1.5rem;
    }
}

/* =================================================================
   PRIVACY BANNER — shown at the top of the onboarding form
   ================================================================= */

.elg-privacy-banner {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    background: linear-gradient(135deg, #eff6ff 0%, #f0f4ff 100%);
    border: 1px solid #bfdbfe;
    border-left: 4px solid var(--elg-primary-color);
    border-radius: 12px;
    margin: 1.5rem 1.5rem 0;
    padding: 1.5rem;
}

.elg-privacy-banner__icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.elg-privacy-banner__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.elg-privacy-banner__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--elg-primary-color);
    margin: 0 0 0.75rem;
}

/* Required clause — visually prominent */
.elg-clausula--required {
    background: #fff !important;
    border: 2px solid var(--elg-primary-color) !important;
    border-radius: 8px;
    padding: 0.875rem !important;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.08);
}

.elg-clausula--required label {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: var(--elg-text-primary) !important;
}

.elg-clausula--required input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.elg-required {
    color: var(--elg-danger-color);
    font-weight: 700;
    margin-left: 0.25rem;
}

.elg-field-error {
    display: none;
    color: var(--elg-danger-color);
    font-size: 0.8rem;
    margin-top: 0.375rem;
}

.elg-field-error.is-visible {
    display: block;
}

.elg-input.elg-input--error {
    border-color: var(--elg-danger-color);
}

/* Optional clauses inside the banner — softer */
.elg-privacy-banner .elg-clausula:not(.elg-clausula--required) {
    background: rgba(255, 255, 255, 0.65);
    border-color: var(--elg-gray-200);
	background: #fff !important;
    /*border: 2px solid var(--elg-primary-color) !important;*/
    border-radius: 8px;
    padding: 0.875rem !important;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.08);
}

.elg-privacy-banner .elg-clausula:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .elg-privacy-banner {
        flex-direction: column;
        gap: 0.75rem;
        margin: 1rem 1rem 0;
        padding: 1.25rem;
    }

    .elg-privacy-banner__icon {
        font-size: 1.5rem;
    }
}

/* =================================================================
    Modern password form (moved from inline styles)
    ================================================================= */
.elg-modern-password { max-width: 420px; margin: 0 auto; text-align: center; }
.elg-modern-password .elg-field-group { margin-bottom: 16px; }
.elg-modern-password .elg-input { padding: 12px 40px 12px 12px; width: 100%; box-sizing: border-box; border: 1px solid #e5e7eb; border-radius: 8px; }
.elg-modern-password .elg-input-wrap { position: relative; }
.elg-modern-password .elg-eye { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 6px; font-size: 14px; line-height: 1; }
.elg-modern-password .elg-btn-primary { display: inline-block; margin-top: 8px; padding: 10px 20px; border-radius: 8px; }
.elg-password-row { display:flex; gap:12px; align-items:stretch; margin-bottom:12px; }
.elg-password-row .elg-field-group { position:relative; flex:1; margin-bottom:0; }
@media (max-width:640px){ .elg-password-row{ flex-direction:column; } }

/* Campos de contraseña del formulario de completar registro (wrapper .elg-input-wrapper,
   distinto del .elg-input-wrap que usa el formulario de cambiar contraseña del perfil). */
.elg-password-field-group .elg-input { padding-right: 40px; }
.elg-password-field-group .elg-eye {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; padding: 6px; font-size: 14px; line-height: 1;
}
