/* =============================================================
   Custom Form Handler – Form Styles
   ============================================================= */

:root {
    --cfh-accent:       #E86401;
    --cfh-accent-dark:  #c85600;
    --cfh-border:       #d0d0d0;
    --cfh-bg:           #f9f9f9;
    --cfh-text:         #222;
    --cfh-muted:        #666;
    --cfh-radius:       6px;
    --cfh-transition:   0.2s ease;
}

/* Container */
.cfh-form-container {
    max-width: 620px;
    margin: 0 auto;
    padding: 28px 32px;
    border: 1px solid var(--cfh-border);
    border-radius: var(--cfh-radius);
    background: var(--cfh-bg);
    font-family: Arial, Helvetica, sans-serif;
    color: var(--cfh-text);
    box-sizing: border-box;
}

.cfh-intro {
    margin: 0 0 20px;
    font-size: 0.95em;
    color: var(--cfh-muted);
}

/* Steps */
.cfh-step        { display: none; }
.cfh-step.active { display: block; }

.cfh-step h2 {
    margin: 0 0 18px;
    font-size: 1.1em;
    color: var(--cfh-text);
}

/* Form groups */
.cfh-form-group {
    margin-bottom: 16px;
}

.cfh-form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    color: var(--cfh-text);
    font-size: 0.95em;
}

.cfh-optional {
    font-weight: normal;
    color: var(--cfh-muted);
    font-size: 0.9em;
}

.cfh-form-group input[type="text"],
.cfh-form-group input[type="email"],
.cfh-form-group input[type="tel"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--cfh-border);
    border-radius: var(--cfh-radius);
    box-sizing: border-box;
    font-size: 1em;
    color: var(--cfh-text);
    background: #fff;
    transition: border-color var(--cfh-transition), box-shadow var(--cfh-transition);
}

.cfh-form-group input:focus {
    outline: none;
    border-color: var(--cfh-accent);
    box-shadow: 0 0 0 3px rgba(232, 100, 1, 0.15);
}

.cfh-form-group input:invalid:not(:placeholder-shown) {
    border-color: #c0392b;
}

/* Radio button groups */
.cfh-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.cfh-option-label {
    cursor: pointer;
    user-select: none;
}

.cfh-option-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cfh-option-label span {
    display: inline-block;
    padding: 10px 16px;
    border: 2px solid var(--cfh-border);
    border-radius: var(--cfh-radius);
    background: #fff;
    color: var(--cfh-text);
    font-size: 0.95em;
    transition: border-color var(--cfh-transition), background var(--cfh-transition), color var(--cfh-transition);
}

.cfh-option-label:hover span {
    border-color: var(--cfh-accent);
    background: #fff4ec;
}

.cfh-option-label input[type="radio"]:checked + span {
    border-color: var(--cfh-accent);
    background: var(--cfh-accent);
    color: #fff;
    font-weight: bold;
}

.cfh-option-label input[type="radio"]:focus-visible + span {
    outline: 3px solid var(--cfh-accent);
    outline-offset: 2px;
}

/* DSGVO checkbox */
.cfh-gdpr {
    margin-top: 12px;
}

.cfh-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: normal !important;
    cursor: pointer;
    line-height: 1.5;
    font-size: 0.9em;
    color: var(--cfh-text);
}

.cfh-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--cfh-accent);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.cfh-checkbox-label a {
    color: var(--cfh-accent);
    text-decoration: underline;
}

/* Buttons */
.cfh-nav {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cfh-btn {
    padding: 11px 22px;
    border: none;
    border-radius: var(--cfh-radius);
    font-size: 0.95em;
    font-weight: bold;
    cursor: pointer;
    transition: background var(--cfh-transition);
}

.cfh-btn--next,
.cfh-btn--submit {
    background: var(--cfh-accent);
    color: #fff;
}

.cfh-btn--next:hover,
.cfh-btn--submit:hover {
    background: var(--cfh-accent-dark);
}

.cfh-btn--prev {
    background: #e5e5e5;
    color: var(--cfh-text);
}

.cfh-btn--prev:hover {
    background: #d0d0d0;
}

.cfh-btn--submit:disabled,
.cfh-btn--next:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Progress bar */
.cfh-progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e5e5;
    border-radius: 99px;
    margin-top: 28px;
    overflow: hidden;
}

.cfh-progress-fill {
    height: 100%;
    background: var(--cfh-accent);
    width: 20%;
    border-radius: 99px;
    transition: width 0.35s ease;
}

.cfh-step-counter {
    margin: 8px 0 0;
    font-size: 0.82em;
    color: var(--cfh-muted);
    text-align: right;
}

/* Error message */
.cfh-error-msg {
    display: none;
    background: #fdecea;
    border: 1px solid #f5c6c6;
    color: #b32b2b;
    padding: 10px 14px;
    border-radius: var(--cfh-radius);
    margin-bottom: 16px;
    font-size: 0.92em;
}

/* small helper text */
.cfh-step small {
    display: block;
    margin-top: 6px;
    font-size: 0.85em;
    color: var(--cfh-muted);
}

/* Honeypot: visually hidden but not display:none (defeats some bots) */
.cfh-hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    tab-index: -1;
}

/* Responsive */
@media (max-width: 480px) {
    .cfh-form-container {
        padding: 18px 16px;
    }
    .cfh-btn-group {
        flex-direction: column;
    }
    .cfh-option-label span {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    .cfh-nav {
        flex-direction: column;
    }
    .cfh-btn {
        width: 100%;
        text-align: center;
    }
}
