//* ===============================
   FORMULIER STYLING
   Passend bij het kleurrijke design
   =============================== */

/* Form Container */
#mx_form_{{ form.id }} {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
}

/* Success Message */
.mx_success {
    background: linear-gradient(135deg, var(--lichtdonkergroen), var(--lichtgroen));
    color: var(--donkergroen);
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    border-left: 5px solid var(--donkergroen);
    font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
    box-shadow: 0 4px 15px rgba(57, 176, 114, 0.2);
}


/* Error Message (algemeen) */
.mx_error {
    background: linear-gradient(135deg, var(--lichtrood), #fef0ee);
    color: var(--rood);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 5px solid var(--rood);
    font-size: clamp(0.9rem, 0.85rem + 0.3vw, 1rem);
    box-shadow: 0 4px 15px rgba(190, 29, 46, 0.15);
}

/* Form Styling */
.mx_form {
  
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* Extra Info Section */
.mx_form_row:has(#extra_info_*) {
    background: var(--lichtblauw);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 15px;
}

.mx_form_row:has(#extra_info_*) label {
    color: var(--blauw);
    font-weight: 600;
}

.mx_form_input[id^="extra_info_"] {
    color: var(--zwart);
    font-weight: 500;
    margin-top: 8px;
}

/* Spacer */
.mx_form_spacer {
    height: 30px;
}

/* Label Heading */
.mx_form_label {
    font-size: clamp(1.3rem, 1.15rem + 0.9vw, 1.8rem);
    font-weight: 600;
    color: var(--blauw);
    margin-bottom: 20px;
    margin-top: 30px;
    padding-bottom: 10px;
    border-bottom: 3px solid transparent;
    background: linear-gradient(90deg, var(--blauw), var(--paars), var(--donkergroen)) left bottom no-repeat;
    background-size: 100% 3px;
}

/* Form Row */
.mx_form_row {
    margin-bottom: 25px;
}

/* Hidden Row */
.mx_form_row.mx_hidden {
    display: none;
}

/* Row with Error */
.mx_form_row.mx_error {
    background: var(--lichtrood);
    padding: 20px;
    border-radius: 15px;
    border-left: 5px solid var(--rood);
}

.mx_form_row.mx_error label {
    color: var(--rood);
}

/* Labels */
.mx_form_row label {
    display: block;
    font-weight: 600;
    font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.05rem);
    color: var(--zwart);
    margin-bottom: 10px;
}

.mx_form_row label::after {
    content: '';
}

/* Mandatory Indicator */
.mx_form_row label:has(+ .mx_form_input input[required])::after,
.mx_form_row label:has(+ .mx_form_input textarea[required])::after {
    content: ' *';
    color: var(--rood);
}

/* Input Container */
.mx_form_input {
    width: 100%;
}

/* Text Inputs */
.mx_form_input input[type="text"],
.mx_form_input input[type="email"],
.mx_form_input input[type="password"],
.mx_form_input input[type="file"],
.mx_form_input select,
.mx_form_input textarea {
    width: 100%;
    padding: 12px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.05rem);
    font-family: "Poppins", sans-serif;
    color: var(--zwart);
    transition: all 0.3s ease;
    background-color: var(--wit);
}

.mx_form_input input[type="text"]:focus,
.mx_form_input input[type="email"]:focus,
.mx_form_input input[type="password"]:focus,
.mx_form_input select:focus,
.mx_form_input textarea:focus {
    outline: none;
    border-color: var(--blauw);
    box-shadow: 0 0 0 4px rgba(18, 117, 187, 0.1);
}

/* Placeholder */
.mx_form_input input::placeholder,
.mx_form_input textarea::placeholder {
    color: #999;
    opacity: 1;
}

/* Datepicker */
.mx_form_input input.datepicker {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%231275bb" stroke-width="2"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 45px;
}

/* File Upload */
.mx_form_input input[type="file"] {
    padding: 10px;
    border: 2px dashed #e0e0e0;
    cursor: pointer;
}

.mx_form_input input[type="file"]:hover {
    border-color: var(--blauw);
    background-color: var(--lichtblauw);
}

/* Textarea */
.mx_form_input textarea {
    min-height: 120px;
    resize: vertical;
}

/* Select Dropdown */
.mx_form_input select {
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%231275bb" d="M6 9L1 4h10z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

/* Checkboxes and Radio Buttons */
.mx_form_input_option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.mx_form_input_option:hover {
    background-color: var(--lichtblauw);
}

.mx_form_input input[type="checkbox"],
.mx_form_input input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--blauw);
    flex-shrink: 0;
}

/* Newsletter Radio Buttons */
.mx_form_input input[type="radio"].mx_newsletter {
    width: 18px;
    height: 18px;
    margin: 0 8px 0 0;
}

/* Other Option Input */
.mx_form_input_other {
    margin-top: 8px;
    margin-left: 32px;
}

.mx_form_input_other input[type="text"] {
    width: 100%;
}

/* Captcha */
.mx_form_input input.mx_captcha {
    max-width: 100px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Submit Button - gebruikt bestaande btn btn-blauw classes */
.mx_form_row input[type="submit"] {
    /* De submit button gebruikt de btn btn-blauw classes uit je algemene stylesheet */
    font-family: "Poppins", sans-serif;
}

/* Mandatory Text */
#mx_form_{{ form.id }} br + * {
    font-size: clamp(0.85rem, 0.8rem + 0.3vw, 0.95rem);
    color: #666;
    font-style: italic;
    margin-top: 20px;
    display: block;
}

/* Custom Color Variants voor form rows */
.mx_form_row.kleur-geel {
    background: var(--lichtgeel);
    padding: 20px;
    border-radius: 15px;
    border-left: 5px solid var(--geel);
}

.mx_form_row.kleur-blauw {
    background: var(--lichtblauw);
    padding: 20px;
    border-radius: 15px;
    border-left: 5px solid var(--blauw);
}

.mx_form_row.kleur-groen {
    background: var(--lichtgroen);
    padding: 20px;
    border-radius: 15px;
    border-left: 5px solid var(--groen);
}

.mx_form_row.kleur-paars {
    background: var(--lichtpaars);
    padding: 20px;
    border-radius: 15px;
    border-left: 5px solid var(--paars);
}

/* ===============================
   RESPONSIVE AANPASSINGEN
   =============================== */

@media (max-width: 768px) {
    #mx_form_{{ form.id }} {
        padding: 20px;
    }
    
    .mx_form {
        padding: 25px 20px;
        border-radius: 20px;
    }
    
    .mx_buttons {
        flex-direction: column;
    }
    
    .mx_buttons a {
        width: 100%;
        text-align: center;
    }
    
    .mx_form_input input[type="text"],
    .mx_form_input input[type="email"],
    .mx_form_input input[type="password"],
    .mx_form_input select,
    .mx_form_input textarea {
        font-size: 16px; /* Voorkomt zoom op iOS */
    }
}

@media (max-width: 480px) {
    .mx_form {
        padding: 20px 15px;
    }
    
    .mx_form_row {
        margin-bottom: 20px;
    }
    
    .mx_form_label {
        font-size: 1.2rem;
        margin-top: 20px;
    }
}

/* ===============================
   TOEGANKELIJKHEID
   =============================== */

/* Focus states voor toetsenbord navigatie */
.mx_form_input input:focus-visible,
.mx_form_input select:focus-visible,
.mx_form_input textarea:focus-visible {
    outline: 3px solid var(--blauw);
    outline-offset: 2px;
}

/* Screen reader only tekst */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===============================
   ANIMATIES
   =============================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mx_form_row {
    animation: fadeIn 0.4s ease-out;
}

/* Stagger animatie voor form rows */
.mx_form_row:nth-child(1) { animation-delay: 0.05s; }
.mx_form_row:nth-child(2) { animation-delay: 0.1s; }
.mx_form_row:nth-child(3) { animation-delay: 0.15s; }
.mx_form_row:nth-child(4) { animation-delay: 0.2s; }
.mx_form_row:nth-child(5) { animation-delay: 0.25s; }