/**
 * Mobile-friendly Terms & Conditions checkbox styling
 * Follows WCAG 2.5.8 guidelines for touch target size (minimum 24x24px)
 * 
 * IMPORTANT: This CSS only affects elements within .terms-checkbox-container
 * to avoid impacting other form inputs on the page.
 */

.terms-acceptance-field {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Container for checkbox and label */
.terms-checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem; /* 12px spacing between checkbox and text */
    min-height: 24px;
}

/* Checkbox styling - WCAG compliant 24x24px touch target */
/* ONLY applies to checkbox inside .terms-checkbox-container */
.terms-checkbox-container > input[type="checkbox"] {
    /* Increase checkbox size for better mobile usability */
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    
    /* Ensure checkbox stays at top when text wraps */
    flex-shrink: 0;
    margin-top: 2px;
    
    /* Better visual appearance */
    cursor: pointer;
    accent-color: #00d1b2; /* Bulma primary color */
}

/* Label text styling */
/* ONLY applies to label inside .terms-checkbox-container */
.terms-checkbox-container > label {
    flex: 1;
    cursor: pointer;
    line-height: 1.5;
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* Link styling within the label */
/* ONLY applies to links inside .terms-checkbox-container label */
.terms-checkbox-container > label a {
    /* Add padding for easier tapping without changing display */
    padding: 4px 2px;
}

/* Mobile-specific adjustments */
@media screen and (max-width: 768px) {
    .terms-checkbox-container {
        gap: 1rem; /* Slightly more spacing on mobile */
    }
    
    .terms-checkbox-container > input[type="checkbox"] {
        /* Slightly larger on mobile for easier tapping */
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
    }
    
    .terms-checkbox-container > label {
        font-size: 1rem; /* Slightly larger text on mobile */
    }
    
    .terms-checkbox-container > label a {
        /* Slightly more padding on mobile for easier tapping */
        padding: 6px 4px;
    }
}

/* Error state styling */
.terms-checkbox-container.has-error {
    border: 1px solid #f14668;
    padding: 0.75rem;
    border-radius: 4px;
    background-color: #feecf0;
}

.terms-checkbox-container + .help.is-danger {
    margin-top: 0.5rem;
}

/* Focus state for accessibility */
.terms-checkbox-container > input[type="checkbox"]:focus {
    outline: 2px solid #3273dc;
    outline-offset: 2px;
}

/* Ensure proper spacing in Bulma field context */
.field .terms-checkbox-container {
    margin-top: 0;
}
