/* ========================================
   MILLA USERS CREATOR
   Estilos coherentes con el diseño de Milla
   ======================================== */

.milla-users-creator-wrapper {
    background: transparent;
    padding: 0;
    margin: 0;
}

/* Cuando está dentro de un tab, respetar el padding del tab-content */
.milla-tab-content .milla-users-creator-wrapper {
    padding: 0;
}

.milla-users-creator-header {
    margin-bottom: 30px;
}


.milla-users-creator-description {
    margin: 10px 0 0 0;
    color: var(--milla-formpage-color-primary-dark);
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.85;
}

.milla-add-user-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}


.milla-form-section h5,
.milla-tab-content .milla-form-section h5 {
    margin: 0 0 20px 0;
    color: var(--milla-formpage-color-primary-dark);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.milla-form-row,
.milla-tab-content .milla-form-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.milla-password-form-row,
.milla-tab-content .milla-password-form-row {
    flex-direction: row;
}

.milla-form-group,
.milla-tab-content .milla-form-group {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.milla-form-group label,
.milla-tab-content .milla-form-group label {
    display: inline-block;
    margin-bottom: 0;
    font-weight: 600;
    color: var(--milla-formpage-color-primary-dark);
    font-size: 16px;
    white-space: nowrap;
    min-width: 120px;
    flex-shrink: 0;
}

/* ========================================
   INPUTS Y SELECTS - Coherentes con milla-public.css
   ======================================== */
.milla-form-group input,
.milla-form-group select,
.milla-tab-content .milla-form-group input,
.milla-tab-content .milla-form-group select {
    border: 2px solid var(--milla-formpage-color-secondary-dark) !important;
    border-radius: 50px !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
    color: var(--milla-formpage-color-primary-dark) !important;
    background: white !important;
    transition: all 0.2s ease;
    line-height: 1.4;
    font-family: inherit;
    box-shadow: none !important;
    flex: 0 0 60% !important;
    width: 60% !important;
    margin-left: auto;
}

.milla-form-group input:focus,
.milla-form-group select:focus,
.milla-tab-content .milla-form-group input:focus,
.milla-tab-content .milla-form-group select:focus {
    outline: none !important;
    border-color: var(--milla-formpage-color-primary-dark) !important;
    box-shadow: none !important;
}

.milla-form-group input:hover,
.milla-form-group select:hover,
.milla-tab-content .milla-form-group input:hover,
.milla-tab-content .milla-form-group select:hover {
    border-color: var(--milla-formpage-color-primary-dark);
}

.milla-form-group input.error,
.milla-form-group select.error,
.milla-tab-content .milla-form-group input.error,
.milla-tab-content .milla-form-group select.error {
    border-color: #dc3232 !important;
    box-shadow: 0 0 0 3px rgba(220, 50, 50, 0.1);
}

.milla-password-row,
.milla-tab-content .milla-password-row {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.milla-password-row .milla-form-group,
.milla-tab-content .milla-password-row .milla-form-group {
    flex: 1;
    min-width: 250px;
}

.milla-password-row .generate-btn,
.milla-tab-content .milla-password-row .generate-btn {
    flex-shrink: 0;
    margin-bottom: 0;
}

/* ========================================
   INTEREST AREAS CHECKBOXES
   ======================================== */
.milla-interest-areas,
.milla-tab-content .milla-interest-areas {
    margin-top: 20px;
}

.milla-interest-areas > label,
.milla-tab-content .milla-interest-areas > label,
.milla-tab-content .milla-interest-areas label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--milla-formpage-color-primary-dark);
    font-size: 16px;
}

.milla-interest-checkboxes,
.milla-area-checkboxes,
.milla-tab-content .milla-interest-checkboxes,
.milla-tab-content .milla-area-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.milla-interest-checkbox,
.milla-area-checkbox,
.milla-tab-content .milla-interest-checkbox,
.milla-tab-content .milla-area-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 16px;
    color: var(--milla-formpage-color-primary-dark);
    padding: 12px 18px;
    border-radius: 50px; /* Más redondeado */
    border: 2px solid var(--milla-formpage-color-secondary-dark);
    background: white;
    transition: all 0.2s ease;
    font-weight: 500;
    outline: none;
}

.milla-interest-checkbox:hover,
.milla-area-checkbox:hover,
.milla-tab-content .milla-interest-checkbox:hover,
.milla-tab-content .milla-area-checkbox:hover {
    background: var(--milla-formpage-color-primary);
    border-color: var(--milla-formpage-color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(97, 124, 55, 0.15);
}

.milla-interest-checkbox input[type="checkbox"],
.milla-area-checkbox input[type="checkbox"],
.milla-tab-content .milla-interest-checkbox input[type="checkbox"],
.milla-tab-content .milla-area-checkbox input[type="checkbox"] {
    font: inherit !important;
    color: var(--milla-formpage-color-primary-dark) !important;
    width: 1.15em !important;
    height: 1.15em !important;
    border: 0.15em solid var(--milla-formpage-color-primary-dark) !important;
    border-radius: 0.35em !important; /* Más redondeado */
    transform: translateY(-0.075em) !important;
    cursor: pointer !important;
    margin: 0 !important;
    outline: none !important;
}

.milla-interest-checkbox input[type="checkbox"]:checked,
.milla-area-checkbox input[type="checkbox"]:checked,
.milla-tab-content .milla-interest-checkbox input[type="checkbox"]:checked,
.milla-tab-content .milla-area-checkbox input[type="checkbox"]:checked {
    background-color: var(--milla-formpage-color-primary-dark) !important;
    border-color: var(--milla-formpage-color-primary-dark) !important;
    color: #ffffff !important;
}

.milla-interest-checkbox span,
.milla-tab-content .milla-interest-checkbox span {
    cursor: pointer;
    font-weight: 500;
    line-height: 1.4;
}

/* ========================================
   BOTONES - Coherentes con milla-public.css
   ======================================== */
.milla-form-actions,
.milla-tab-content .milla-form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 3px solid rgba(66, 78, 0, 0.3);
}

.milla-users-creator-wrapper .submit-btn,
.milla-tab-content .submit-btn {
    background: var(--milla-formpage-color-primary-dark);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px; /* Más redondeado */
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.milla-users-creator-wrapper .submit-btn:hover,
.milla-tab-content .submit-btn:hover {
    background: var(--milla-formpage-color-primary-alt);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(97, 124, 55, 0.3);
}

.milla-users-creator-wrapper .submit-btn:focus,
.milla-tab-content .submit-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

.milla-users-creator-wrapper .submit-btn:active,
.milla-tab-content .submit-btn:active {
    transform: translateY(0);
}

.milla-users-creator-wrapper .generate-btn,
.milla-tab-content .generate-btn {
    background: var(--milla-formpage-color-secondary);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px; /* Más redondeado */
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px !important;
}

.milla-users-creator-wrapper .generate-btn:hover,
.milla-tab-content .generate-btn:hover {
    background: var(--milla-formpage-color-secondary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(97, 124, 55, 0.3);
}

.milla-users-creator-wrapper .generate-btn:focus,
.milla-tab-content .generate-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

.milla-users-creator-wrapper .generate-btn:active,
.milla-tab-content .generate-btn:active {
    transform: translateY(0);
}

/* ========================================
   MENSAJES
   ======================================== */
.milla-message {
    padding: 16px 20px;
    border-radius: 20px;
    margin: 20px 0;
    font-size: 16px;
    line-height: 1.5;
    display: none;
    border: 2px solid;
}

.milla-message.success {
    background: #f7fcf7;
    color: #46b450;
    border-color: #46b450;
}

.milla-message.error {
    background: #fef7f7;
    color: #dc3232;
    border-color: #dc3232;
}

.milla-debug-info {
    margin-top: 20px;
    padding: 16px 20px;
    background: var(--milla-formpage-color-primary);
    border: 2px solid var(--milla-formpage-color-secondary-dark);
    border-radius: 20px;
    font-family: monospace;
    font-size: 14px;
    color: var(--milla-formpage-color-primary-dark);
    max-height: 300px;
    overflow-y: auto;
}

/* ========================================
   PASSWORD TOGGLE
   ======================================== */
.milla-password-input-wrapper,
.milla-tab-content .milla-password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.milla-password-input-wrapper input[type="password"],
.milla-password-input-wrapper input[type="text"],
.milla-tab-content .milla-password-input-wrapper input[type="password"],
.milla-tab-content .milla-password-input-wrapper input[type="text"] {
    flex: 1;
    padding-right: 50px !important;
}

.milla-password-toggle,
.milla-tab-content .milla-password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--milla-formpage-color-primary-dark);
    transition: all 0.2s ease;
    z-index: 10;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.milla-password-toggle:hover,
.milla-tab-content .milla-password-toggle:hover {
    background-color: var(--milla-formpage-color-primary);
    color: var(--milla-formpage-color-primary-dark);
}

.milla-password-toggle i,
.milla-tab-content .milla-password-toggle i {
    font-size: 20px;
    line-height: 1;
    display: block;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .milla-users-creator-wrapper {
        padding: 0;
    }
    
    .milla-tab-content .milla-users-creator-wrapper {
        padding: 0;
    }
    
    .milla-form-section {
        padding: 20px;
    }
    
    .milla-password-row,
    .milla-tab-content .milla-password-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .milla-password-row .milla-form-group,
    .milla-tab-content .milla-password-row .milla-form-group {
        min-width: 100%;
    }
    
    .milla-form-actions,
    .milla-tab-content .milla-form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .milla-form-actions button,
    .milla-tab-content .milla-form-actions button {
        width: 100%;
    }
    
    .milla-interest-checkboxes,
    .milla-tab-content .milla-interest-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .milla-form-row,
    .milla-tab-content .milla-form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .milla-form-group,
    .milla-tab-content .milla-form-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .milla-form-group label,
    .milla-tab-content .milla-form-group label {
        min-width: auto;
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .milla-users-creator-header h2 {
        font-size: 20px;
    }
    
    .milla-form-section h5 {
        font-size: 16px;
    }
    
    .milla-form-group input,
    .milla-form-group select {
        font-size: 14px !important;
        padding: 10px 16px !important;
    }
    
    .milla-users-creator-wrapper .submit-btn,
    .milla-users-creator-wrapper .generate-btn {
        font-size: 14px;
        padding: 10px 24px;
    }
    
    .milla-password-toggle {
        padding: 6px;
        min-width: 28px;
        min-height: 28px;
    }
    
    .milla-password-toggle i {
        font-size: 18px;
    }
}
