/* Kundenkarte — Mobile-first form styling */

.kk-wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
    background: #eef0f4;
    border-radius: 16px;
}

/* Header */
.kk-header {
    text-align: center;
    margin-bottom: 24px;
}

.kk-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #1a1a1a;
}

.kk-header p {
    font-size: 15px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* ACF form reset — strip default ACF styles */
.kk-wrap .acf-form-submit,
.kk-wrap .acf-fields {
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

.kk-wrap .acf-field {
    padding: 0 !important;
    margin-bottom: 16px !important;
    border: none !important;
    min-height: auto !important;
}

/* Labels */
.kk-wrap .acf-label {
    margin-bottom: 6px !important;
}

.kk-wrap .acf-label label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Field instructions (e.g. Geburtstag hint) */
.kk-wrap .acf-field .description,
.kk-wrap .acf-field .acf-tip,
.kk-wrap .acf-field p.description {
    font-size: 13px !important;
    color: #999 !important;
    margin-top: 4px !important;
    font-style: normal !important;
}

/* Required asterisk — dark blue matching header/footer */
.kk-wrap .acf-required {
    color: #111821;
}

/* Text/Email/Date inputs */
.kk-wrap .acf-input input[type="text"],
.kk-wrap .acf-input input[type="email"],
.kk-wrap .acf-input input[type="tel"],
.kk-wrap .acf-input input[type="date"],
.kk-wrap .acf-input input[type="number"],
.kk-wrap .acf-input-wrap input,
.kk-wrap .acf-date-picker input {
    width: 100% !important;
    padding: 14px 16px !important;
    font-size: 16px !important; /* Prevents iOS zoom on focus */
    line-height: 1.4 !important;
    border: 2px solid #e2e2e2 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #1a1a1a !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    transition: border-color 0.2s, background-color 0.2s !important;
    box-sizing: border-box !important;
}

.kk-wrap .acf-input input:focus,
.kk-wrap .acf-input-wrap input:focus {
    border-color: #111820 !important;
    background: #fff !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1) !important;
}

/* Placeholder */
.kk-wrap input::placeholder {
    color: #aaa;
}

/* Checkbox group — "Gefunden durch"
   ACF's .acf-bl adds ::before and ::after pseudo-elements (clearfix).
   In CSS grid, these pseudo-elements become grid items and push
   the first checkbox to the second column. Kill them. */
.kk-wrap ul.acf-bl::before,
.kk-wrap ul.acf-bl::after {
    display: none !important;
    content: none !important;
}

.kk-wrap .acf-checkbox-list,
.kk-wrap ul.acf-checkbox-list,
.kk-wrap ul.acf-checkbox-list.acf-bl {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    width: 100% !important;
}

.kk-wrap .acf-checkbox-list li,
.kk-wrap ul.acf-checkbox-list li {
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

.kk-wrap .acf-checkbox-list label {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 12px 14px !important;
    font-size: 14px !important;
    background: #fff !important;
    border: 2px solid #e2e2e2 !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: all 0.15s !important;
    -webkit-tap-highlight-color: transparent !important;
    user-select: none !important;
    white-space: nowrap !important;
}

.kk-wrap .acf-checkbox-list label:active {
    transform: scale(0.97);
}

.kk-wrap .acf-checkbox-list input:checked + span,
.kk-wrap .acf-checkbox-list input[type="checkbox"]:checked ~ span {
    color: #111820;
    font-weight: 500;
}

.kk-wrap .acf-checkbox-list input:checked {
    accent-color: #111820 !important;
}

/* Scale up checkboxes for touch */
.kk-wrap input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    accent-color: #111820 !important;
    cursor: pointer !important;
}

/* True/False (consent toggles) — checkbox top-left, text right */
.kk-wrap .acf-field-true-false {
    display: grid !important;
    grid-template-columns: 28px 1fr !important;
    grid-template-rows: auto !important;
    gap: 0 8px !important;
    padding: 14px !important;
    background: #f7f7f7 !important;
    border-radius: 12px !important;
    border: 2px solid #e2e2e2 !important;
}

/* Put the checkbox (acf-input) in column 1 */
.kk-wrap .acf-field-true-false > .acf-input {
    grid-column: 1 !important;
    grid-row: 1 / 3 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Put the label text in column 2 */
.kk-wrap .acf-field-true-false > .acf-label {
    grid-column: 2 !important;
    grid-row: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.kk-wrap .acf-field-true-false .acf-label label {
    font-size: 13px !important;
    line-height: 1.5 !important;
    color: #444 !important;
}

.kk-wrap .acf-field-true-false .acf-label .description {
    font-size: 12px !important;
    color: #888 !important;
    margin-top: 2px !important;
}

.kk-wrap .acf-field-true-false .acf-true-false label {
    display: block !important;
    margin-top: 1px !important;
}

/* "Sonstiges" text field — conditional, seamless */
.kk-wrap .acf-field[data-name="gefunden_sonstiges"] {
    margin-top: -8px !important;
}

/* Consent info */
.kk-consent-info {
    text-align: center;
    margin-top: 8px;
    padding: 0 8px;
}

.kk-consent-info small {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
}

/* Submit button — matches site style */
.kk-submit {
    display: block !important;
    width: 100% !important;
    padding: 16px !important;
    margin-top: 24px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    letter-spacing: 0.8px !important;
    text-transform: uppercase !important;
    color: #232323 !important;
    background: #fff !important;
    border: 2px solid #484848 !important;
    border-radius: 7px !important;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    transition: background-color 0.2s, color 0.2s, transform 0.1s !important;
    -webkit-tap-highlight-color: transparent !important;
}

.kk-submit:hover {
    background: #111820 !important;
    color: #fff !important;
    border-color: #111820 !important;
}

.kk-submit:active {
    background: #000 !important;
    color: #fff !important;
    transform: scale(0.98) !important;
}

/* Success state */
.kk-success {
    text-align: center;
    padding: 48px 24px;
}

.kk-success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: #27ae60;
    color: #fff;
    font-size: 36px;
    line-height: 72px;
    border-radius: 50%;
    animation: kk-pop 0.4s ease;
}

.kk-success h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.kk-success p {
    font-size: 15px;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

@keyframes kk-pop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* ACF form-submit spacing */
.kk-wrap .acf-form-submit {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Validation errors */
.kk-wrap .acf-error-message {
    border-radius: 10px !important;
    font-size: 13px !important;
    padding: 10px 14px !important;
}

.kk-wrap .acf-field .acf-notice.-error {
    border-radius: 8px !important;
    margin-top: 6px !important;
}

/* Date picker popup — touch friendly */
.ui-datepicker {
    font-size: 14px !important;
}

.ui-datepicker td a,
.ui-datepicker td span {
    padding: 8px !important;
}

/* Desktop adjustments (>480px) */
@media (min-width: 481px) {
    .kk-wrap {
        padding: 32px;
    }

    .kk-header h2 {
        font-size: 28px;
    }

    .kk-wrap .acf-checkbox-list,
    .kk-wrap ul.acf-checkbox-list,
    .kk-wrap ul.acf-checkbox-list.acf-bl {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* Very small phones */
@media (max-width: 359px) {
    .kk-wrap .acf-checkbox-list {
        grid-template-columns: 1fr;
    }

    .kk-wrap {
        padding: 12px;
    }
}

/* Hide ACF elements we don't need on frontend */
.kk-wrap .acf-field-group-conditions,
.kk-wrap .acf-fields > .acf-tab-wrap {
    display: none !important;
}

/* Smooth scroll to errors on validation fail */
html {
    scroll-behavior: smooth;
}

/* ============================================================
   KONTAKTFORMULAR — placeholder-only style, matches kundenkarte
   ============================================================ */
.kf-wrap {
    max-width: 480px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
}

/* Header — matches kundenkarte */
.kf-header {
    text-align: center;
    margin-bottom: 24px;
}

.kf-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px;
    color: inherit;
}

.kf-header p {
    font-size: 15px;
    color: inherit;
    opacity: 0.7;
    margin: 0;
    line-height: 1.4;
}

/* Field labels — matches kundenkarte */
.kf-field > label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: inherit;
}

.kf-required {
    color: #111821;
}

.kf-field {
    margin-bottom: 16px;
}

/* Inputs — rounded, padded, same as kundenkarte */
.kf-wrap input[type="text"],
.kf-wrap input[type="email"],
.kf-wrap textarea {
    width: 100% !important;
    padding: 14px 16px !important;
    font-size: 16px !important; /* prevents iOS zoom */
    line-height: 1.4 !important;
    border: 2px solid #e2e2e2 !important;
    border-radius: 12px !important;
    background: #fafafa !important;
    color: #1a1a1a !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s, background-color 0.2s !important;
}

.kf-wrap input::placeholder,
.kf-wrap textarea::placeholder {
    color: #aaa !important;
}

.kf-wrap input:focus,
.kf-wrap textarea:focus {
    border-color: #111820 !important;
    background: #fff !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(17, 24, 32, 0.1) !important;
}

.kf-wrap textarea {
    resize: vertical !important;
    min-height: 120px !important;
}

/* Consent checkbox — same layout as kundenkarte */
.kf-wrap .kf-consent {
    display: grid !important;
    grid-template-columns: 28px 1fr !important;
    gap: 0 8px !important;
    padding: 14px !important;
    background: rgba(255,255,255,0.08) !important;
    border-radius: 12px !important;
    border: 2px solid #e2e2e2 !important;
}

.kf-wrap .kf-consent label {
    display: contents !important;
    cursor: pointer !important;
}

.kf-wrap .kf-consent input[type="checkbox"] {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    margin-top: 1px !important;
    accent-color: #111820 !important;
    cursor: pointer !important;
}

.kf-wrap .kf-consent span {
    grid-column: 2 !important;
    grid-row: 1 !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    color: inherit !important;
    opacity: 0.8;
}

/* Submit button — matches site style */
.kf-wrap .kf-submit {
    display: block !important;
    width: 100% !important;
    padding: 16px !important;
    margin-top: 24px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    letter-spacing: 0.8px !important;
    text-transform: uppercase !important;
    color: #232323 !important;
    background: #fff !important;
    border: 2px solid #484848 !important;
    border-radius: 7px !important;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    transition: background-color 0.2s, color 0.2s, transform 0.1s !important;
    -webkit-tap-highlight-color: transparent !important;
}

.kf-wrap .kf-submit:hover {
    background: #111820 !important;
    color: #fff !important;
    border-color: #111820 !important;
}

.kf-wrap .kf-submit:active {
    transform: scale(0.98) !important;
}

/* Success / Error messages */
.kf-success p,
.kf-error p {
    padding: 16px;
    border-radius: 12px;
    font-size: 15px;
    text-align: center;
    line-height: 1.5;
}

.kf-success p {
    background: rgba(39, 174, 96, 0.15);
    color: #27ae60;
    margin-bottom: 16px;
}

.kf-back {
    display: inline-block;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #232323 !important;
    background: #fff;
    border: 2px solid #484848;
    border-radius: 7px;
    text-decoration: none !important;
    transition: background-color 0.2s, color 0.2s;
}

.kf-back:hover {
    background: #111820;
    color: #fff !important;
    border-color: #111820;
}

.kf-error p {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}
