/**
 * REVOLUTIONARY INPUT CONTROLS
 * 
 * Original, lightweight, and elegant design for radio buttons and checkboxes
 * specifically for the Lifestyle & Goals section.
 * 
 * Author: High Web Strategist & Designer
 * Date: October 29, 2025
 */

/* ============================================
   RADIO BUTTONS - MODERN CARD DESIGN
   ============================================ */

/* Target the Lifestyle & Goals section specifically */
.form-section[data-section="4"] .radio-option,
.form-section[data-section="4"] label.radio-label,
.form-section[data-section="4"] .option-card {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 16px 20px !important;
    background: linear-gradient(145deg, #ffffff, #fafbfc) !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    min-height: 60px !important;
}

/* Hover effect */
.form-section[data-section="4"] .radio-option:hover,
.form-section[data-section="4"] label.radio-label:hover,
.form-section[data-section="4"] .option-card:hover {
    background: linear-gradient(145deg, #fafbfc, #f8f9fa) !important;
    border-color: #cbd5e1 !important;
    transform: translateX(4px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

/* Selected state */
.form-section[data-section="4"] .radio-option.selected,
.form-section[data-section="4"] label.radio-label.selected,
.form-section[data-section="4"] .option-card.selected,
.form-section[data-section="4"] input[type="radio"]:checked + label,
.form-section[data-section="4"] input[type="radio"]:checked ~ .radio-option,
.form-section[data-section="4"] input[type="radio"]:checked ~ .option-card {
    background: linear-gradient(145deg, #fef9e7, #fdf6d8) !important;
    border-color: #D4AF37 !important;
    box-shadow: 
        0 0 0 4px rgba(212, 175, 55, 0.1),
        0 4px 16px rgba(212, 175, 55, 0.15) !important;
}

/* Accent bar for selected state */
.form-section[data-section="4"] .radio-option.selected::before,
.form-section[data-section="4"] label.radio-label.selected::before,
.form-section[data-section="4"] .option-card.selected::before,
.form-section[data-section="4"] input[type="radio"]:checked + label::before,
.form-section[data-section="4"] input[type="radio"]:checked ~ .radio-option::before,
.form-section[data-section="4"] input[type="radio"]:checked ~ .option-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #D4AF37, #B8941F);
    border-radius: 12px 0 0 12px;
}

/* Custom radio button */
.form-section[data-section="4"] .radio-custom {
    width: 24px !important;
    height: 24px !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    position: relative !important;
    flex-shrink: 0 !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Radio button selected state */
.form-section[data-section="4"] .radio-option.selected .radio-custom,
.form-section[data-section="4"] input[type="radio"]:checked ~ * .radio-custom,
.form-section[data-section="4"] input[type="radio"]:checked + label .radio-custom {
    border-color: #D4AF37 !important;
    background: #ffffff !important;
}

/* Inner dot for selected radio */
.form-section[data-section="4"] .radio-option.selected .radio-custom::after,
.form-section[data-section="4"] input[type="radio"]:checked ~ * .radio-custom::after,
.form-section[data-section="4"] input[type="radio"]:checked + label .radio-custom::after {
    content: '';
    width: 12px;
    height: 12px;
    background: linear-gradient(145deg, #D4AF37, #B8941F);
    border-radius: 50%;
    display: block;
    animation: radioPopIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes radioPopIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Radio text styling */
.form-section[data-section="4"] .radio-text,
.form-section[data-section="4"] .option-text {
    font-family: 'Montserrat', sans-serif !important;
    font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem) !important;
    font-weight: 500 !important;
    color: #334155 !important;
    line-height: 1.5 !important;
    flex: 1 !important;
}

.form-section[data-section="4"] .radio-option.selected .radio-text,
.form-section[data-section="4"] .option-card.selected .option-text,
.form-section[data-section="4"] input[type="radio"]:checked ~ * .radio-text,
.form-section[data-section="4"] input[type="radio"]:checked + label .radio-text {
    color: #1a365d !important;
    font-weight: 600 !important;
}

/* Option icon (emoji) styling */
.form-section[data-section="4"] .option-icon {
    font-size: 28px !important;
    flex-shrink: 0 !important;
    transition: transform 0.3s ease !important;
}

.form-section[data-section="4"] .radio-option.selected .option-icon,
.form-section[data-section="4"] .option-card.selected .option-icon,
.form-section[data-section="4"] input[type="radio"]:checked ~ * .option-icon {
    transform: scale(1.15) !important;
}

/* ============================================
   CHECKBOXES - ELEGANT TOGGLE DESIGN
   ============================================ */

/* Checkbox container */
.form-section[data-section="4"] .checkbox-option,
.form-section[data-section="4"] label.checkbox-label {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 16px 20px !important;
    background: linear-gradient(145deg, #ffffff, #fafbfc) !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    min-height: 60px !important;
}

/* Hover effect */
.form-section[data-section="4"] .checkbox-option:hover,
.form-section[data-section="4"] label.checkbox-label:hover {
    background: linear-gradient(145deg, #fafbfc, #f8f9fa) !important;
    border-color: #cbd5e1 !important;
    transform: translateX(4px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

/* Selected state */
.form-section[data-section="4"] .checkbox-option.selected,
.form-section[data-section="4"] label.checkbox-label.selected,
.form-section[data-section="4"] input[type="checkbox"]:checked + label,
.form-section[data-section="4"] input[type="checkbox"]:checked ~ .checkbox-option {
    background: linear-gradient(145deg, #fef9e7, #fdf6d8) !important;
    border-color: #D4AF37 !important;
    box-shadow: 
        0 0 0 4px rgba(212, 175, 55, 0.1),
        0 4px 16px rgba(212, 175, 55, 0.15) !important;
}

/* Accent bar for selected checkboxes */
.form-section[data-section="4"] .checkbox-option.selected::before,
.form-section[data-section="4"] input[type="checkbox"]:checked + label::before,
.form-section[data-section="4"] input[type="checkbox"]:checked ~ .checkbox-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #D4AF37, #B8941F);
    border-radius: 12px 0 0 12px;
}

/* Custom checkbox */
.form-section[data-section="4"] .checkbox-custom,
.form-section[data-section="4"] input[type="checkbox"] + .checkbox-custom {
    width: 24px !important;
    height: 24px !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    position: relative !important;
    flex-shrink: 0 !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Checkbox selected state */
.form-section[data-section="4"] .checkbox-option.selected .checkbox-custom,
.form-section[data-section="4"] input[type="checkbox"]:checked ~ * .checkbox-custom,
.form-section[data-section="4"] input[type="checkbox"]:checked + label .checkbox-custom {
    border-color: #D4AF37 !important;
    background: linear-gradient(145deg, #D4AF37, #B8941F) !important;
}

/* Checkmark */
.form-section[data-section="4"] .checkbox-option.selected .checkbox-custom::after,
.form-section[data-section="4"] input[type="checkbox"]:checked ~ * .checkbox-custom::after,
.form-section[data-section="4"] input[type="checkbox"]:checked + label .checkbox-custom::after {
    content: '✓';
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    display: block;
    animation: checkPopIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes checkPopIn {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(0deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Checkbox text */
.form-section[data-section="4"] .checkbox-text {
    font-family: 'Montserrat', sans-serif !important;
    font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem) !important;
    font-weight: 500 !important;
    color: #334155 !important;
    line-height: 1.5 !important;
    flex: 1 !important;
}

.form-section[data-section="4"] .checkbox-option.selected .checkbox-text,
.form-section[data-section="4"] input[type="checkbox"]:checked ~ * .checkbox-text,
.form-section[data-section="4"] input[type="checkbox"]:checked + label .checkbox-text {
    color: #1a365d !important;
    font-weight: 600 !important;
}

/* ============================================
   HIDE DEFAULT INPUTS
   ============================================ */

.form-section[data-section="4"] input[type="radio"],
.form-section[data-section="4"] input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ============================================
   GRID LAYOUT FOR OPTIONS
   ============================================ */

.form-section[data-section="4"] .options-grid,
.form-section[data-section="4"] .radio-group,
.form-section[data-section="4"] .checkbox-group {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 16px !important;
    margin: 20px 0 !important;
}

/* Single column for longer text options */
.form-section[data-section="4"] .options-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin: 20px 0 !important;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .form-section[data-section="4"] .radio-option,
    .form-section[data-section="4"] .checkbox-option,
    .form-section[data-section="4"] .option-card,
    .form-section[data-section="4"] label.radio-label,
    .form-section[data-section="4"] label.checkbox-label {
        padding: 14px 16px !important;
        min-height: 56px !important;
    }
    
    .form-section[data-section="4"] .option-icon {
        font-size: 24px !important;
    }
    
    .form-section[data-section="4"] .radio-custom,
    .form-section[data-section="4"] .checkbox-custom {
        width: 22px !important;
        height: 22px !important;
    }
    
    .form-section[data-section="4"] .options-grid,
    .form-section[data-section="4"] .radio-group,
    .form-section[data-section="4"] .checkbox-group {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .form-section[data-section="4"] .radio-option,
    .form-section[data-section="4"] .checkbox-option,
    .form-section[data-section="4"] .option-card,
    .form-section[data-section="4"] label.radio-label,
    .form-section[data-section="4"] label.checkbox-label {
        padding: 12px 14px !important;
        min-height: 52px !important;
        gap: 12px !important;
    }
    
    .form-section[data-section="4"] .option-icon {
        font-size: 22px !important;
    }
    
    .form-section[data-section="4"] .radio-text,
    .form-section[data-section="4"] .checkbox-text,
    .form-section[data-section="4"] .option-text {
        font-size: clamp(0.9375rem, 0.875rem + 0.3125vw, 1.0625rem) !important;
    }
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Focus states for keyboard navigation */
.form-section[data-section="4"] input[type="radio"]:focus + label,
.form-section[data-section="4"] input[type="checkbox"]:focus + label,
.form-section[data-section="4"] input[type="radio"]:focus ~ .radio-option,
.form-section[data-section="4"] input[type="checkbox"]:focus ~ .checkbox-option {
    outline: 3px solid rgba(212, 175, 55, 0.4) !important;
    outline-offset: 2px !important;
}

/* Disabled state */
.form-section[data-section="4"] .radio-option.disabled,
.form-section[data-section="4"] .checkbox-option.disabled,
.form-section[data-section="4"] input[type="radio"]:disabled + label,
.form-section[data-section="4"] input[type="checkbox"]:disabled + label {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .form-section[data-section="4"] .radio-option,
    .form-section[data-section="4"] .checkbox-option,
    .form-section[data-section="4"] .option-card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
    
    .form-section[data-section="4"] .radio-option.selected,
    .form-section[data-section="4"] .checkbox-option.selected {
        background: #f0f0f0 !important;
    }
}
