/* ==========================================================================
   BLOCK: ht-child-auth (Contenedor principal)
   ========================================================================== */
.ht-child-auth {
    background-color: var(--color-bg-body);
    min-height: 100vh;
    padding-bottom: 120px; /* Espacio vital para que el botón flotante no tape la última tarjeta */
    font-family: var(--font-family-body);
}

.ht-child-auth__wrapper {
    margin: 0 auto;
}

/* ==========================================================================
   BLOCK: ht-child-auth-hero (Cabecera Compacta)
   ========================================================================== */
.ht-child-auth-hero {
    background-color: transparent;
    border: none;
    box-shadow: none;
    margin-bottom: var(--spacing-md);
}

.ht-child-auth-hero__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-sm) 0;
}

.ht-child-auth-hero__icon {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-sm);
}

.ht-child-auth-hero__title {
    color: var(--color-text-heading);
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    font-size: var(--text-lg);
    margin: 0 0 6px 0;
    text-align: center;
    letter-spacing: -0.01em;
}

.ht-child-auth-hero__separator {
    width: 40px;
    height: 3px;
    background-color: var(--color-success);
    border-radius: var(--radius-pill);
    margin-bottom: var(--spacing-sm);
}

.ht-child-auth-hero__description {
    color: var(--color-text-subtle);
    font-family: var(--font-family-body);
    font-weight: var(--font-weight-normal);
    font-size: var(--text-sm);
    line-height: 1.4;
    text-align: center;
    margin: 0;
}

/* ==========================================================================
   BLOCK: ht-child-auth__list (Contenedor de tarjetas)
   ========================================================================== */
.ht-child-auth__list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* ==========================================================================
   BLOCK: ht-child-auth-card (Tarjetas Compactas)
   ========================================================================== */
.ht-child-auth-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.ht-child-auth-card:hover:not(.ht-child-auth-card--disabled) {
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-md);
}

.ht-child-auth-card--disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--color-bg-body);
}

.ht-child-auth-card--selected {
    border-color: var(--color-success);
    background: var(--color-bg-card);
}

.ht-child-auth-card__header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.ht-child-auth-card__indicator {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-pill);
    border: 2px solid var(--color-border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.ht-child-auth-card__indicator-inner {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-pill);
    background: var(--color-success);
    opacity: 0;
    transform: scale(0);
    transition: var(--transition-fast);
}

.ht-child-auth-card--selected .ht-child-auth-card__indicator {
    border-color: var(--color-success);
}

.ht-child-auth-card--selected .ht-child-auth-card__indicator-inner {
    opacity: 1;
    transform: scale(1);
}

.ht-child-auth-card__name {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-heading);
    letter-spacing: 0.01em;
}

.ht-child-auth-card__content {
    padding-left: 28px;
}

.ht-child-auth-card__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    row-gap: var(--spacing-sm);
    column-gap: var(--spacing-sm);
}

.ht-child-auth-card__trait {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ht-child-auth-card__trait-label {
    font-family: var(--font-family-ui);
    font-size: 10px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ht-child-auth-card__trait-value {
    font-family: var(--font-family-body);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
}

.ht-child-auth-card__trait-value--positive { color: var(--color-success); }
.ht-child-auth-card__trait-value--neutral { color: var(--color-text-body); }

/* ==========================================================================
   BLOCK: ht-child-auth__add-section (Botón Añadir al final de la lista)
   ========================================================================== */
.ht-child-auth__add-section {
    width: 100%;
    margin-top: var(--spacing-lg);
    position: sticky;
}

.ht-child-auth__add-text {
    font-size: var(--text-xs);
    color: var(--color-text-subtle);
    margin-bottom: var(--spacing-xs);
    text-align: center;
    line-height: 1.2;
}

.ht-child-auth__btn-add {
    width: 100%;
    background: transparent;
    border: 2px dashed var(--color-border-strong);
    color: var(--color-text-body);
    font-weight: var(--font-weight-semibold);
    font-size: var(--text-sm);
    padding: var(--spacing-md);
    border-radius: var(--radius-button);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-base);
}

.ht-child-auth__btn-add:hover {
    background: var(--color-bg-subtle);
    border-color: var(--color-text-muted);
    color: var(--color-text-heading);
}

.ht-child-auth__btn-add-icon {
    margin-right: var(--spacing-sm);
    color: inherit;
}

/* ==========================================================================
   BLOCK: BOTÓN FLOTANTE (FAB) PARA CONTINUAR
   ========================================================================== */
.ht-fab-container {
    position: fixed;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - var(--spacing-xl));
    max-width: 400px;
    z-index: 100;
}

.ht-fab-container button {
    border: none;
    border-radius: var(--radius-pill);
    padding: 16px 24px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ht-fab-container button:disabled {
    background: var(--color-disabled) !important;
    box-shadow: none !important;
    cursor: not-allowed;
    opacity: 0.8;
}

.ht-fab-container button i {
    font-size: 20px;
}

/* ==========================================================================
   BLOCK: ht-child-auth-form (Formulario de registro de menor)
   ========================================================================== */
/* ==========================================================================
   HT-CHILD-AUTH-FORM: ESTRUCTURA BASE
   ========================================================================== */
.ht-child-auth-form {
    font-family: var(--font-family-body);
    color: var(--color-text-body);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    /* Espacio extra para que el footer flotante no tape el contenido al hacer scroll */
    padding-bottom: 120px !important; 
}

/* --- SECCIONES --- */
.ht-child-auth-form__section {
    background: var(--color-bg-card);
    border-radius: var(--radius-card);
    padding: var(--spacing-lg) var(--spacing-md);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-md);
}

.ht-child-auth-form__section-title {
    font-family: var(--font-family-heading);
    font-size: var(--text-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-heading);
    margin: 0 0 var(--spacing-xs) 0;
    letter-spacing: -0.01em;
}

.ht-child-auth-form__section-desc {
    font-family: var(--font-family-body);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-normal);
    color: var(--color-text-subtle);
    margin: 0 0 var(--spacing-lg) 0;
    line-height: 1.4;
}

/* --- GRID DE CAMPOS --- */
.ht-child-auth-form__fields {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.ht-child-auth-form__row--2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

@media (max-width: 768px) {
    .ht-child-auth-form__row--2col { 
        grid-template-columns: 1fr; 
    }
}

.ht-child-auth-form__field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

/* --- LABELS E INPUTS --- */
.ht-child-auth-form__label {
    font-family: var(--font-family-ui);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Plugin Teléfono Full Width */
.ht-child-auth-form__field .iti { 
    width: 100%; 
    display: block; 
}

.ht-child-auth-form__input,
.ht-child-auth-form__textarea {
    background-color: var(--color-bg-card) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-input) !important;
    color: var(--color-text-heading) !important;
    font-family: var(--font-family-body) !important;
    font-size: var(--text-base) !important;
    padding: 12px 16px; 
    box-shadow: none !important;
    transition: var(--transition-base) !important;
}

.ht-child-auth-form__input:focus {
    border-color: var(--color-border-focus) !important;
    box-shadow: 0 0 0 3px var(--color-primary-soft) !important;
}

/* --- TOGGLES (Permisos) --- */
.ht-child-auth-form__toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-bg-subtle);
    padding: var(--spacing-md);
    border-radius: var(--radius-card);
    border: 1px solid var(--color-border-light);
    margin-bottom: var(--spacing-sm);
}

.ht-child-auth-form__switch .form-check-input {
    width: 40px !important;
    height: 24px !important;
    background-color: var(--color-border-strong) !important;
    border: none !important;
    cursor: pointer;
}

.ht-child-auth-form__switch .form-check-input:checked {
    background-color: var(--color-success) !important;
}

/* ==========================================================================
   ACCIONES (FOOTER FIJO)
   ========================================================================== */
.ht-child-auth-form__actions {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    z-index: 2000 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 12px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    padding: 16px !important;
    border-top: 1px solid var(--color-border) !important;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.05) !important;
}


/* RESPONSIVE MÓVIL (Pantallas muy pequeñas) */
@media (max-width: 400px) {
    .ht-child-auth-form__actions {
        flex-direction: column-reverse !important;
        padding: 12px !important;
        gap: 8px !important;
    }
    
    .ht-child-auth-form__btn-cancel,
    .ht-child-auth-form__btn-submit {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 100% !important;
    }
}

button#div_close_authorization_child {
    width: 100% !important;
}

.ht-child-auth-form__toggles {
    padding: 0px;
    margin-bottom: 0px;
}