/* ============================================================
   Kinderfreizeit Anmeldung – Frontend
   Farben per CSS-Variablen aus Plugin-Einstellungen
   ============================================================ */

:root {
    --kfz-primary: #3354a5;
    --kfz-button: #3354a5;
    --kfz-button-hover: #2a4588;
}

.kfz-form-wrap {
    max-width: 720px;
    margin: 2em auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, .08);
    padding: 2.5em 2.5em 2em;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .kfz-form-wrap {
        padding: 1.5em 1.2em 1.2em;
        margin: 1em .5em;
    }
}

/* ---- Grid layout ---- */

.kfz-form .kfz-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1em 1.5em;
}

@media (max-width: 600px) {
    .kfz-form .kfz-fields-grid {
        grid-template-columns: 1fr;
    }
}

.kfz-form .kfz-field {
    margin-bottom: 0;
}

.kfz-form .kfz-field--full {
    grid-column: 1 / -1;
}

/* ---- Labels ---- */

.kfz-form label {
    display: block;
    font-size: .9em;
    font-weight: 600;
    color: #444;
    margin-bottom: .35em;
}

.kfz-required {
    color: #e74c3c;
    margin-left: 2px;
}

/* ---- Inputs ---- */

.kfz-form input[type="text"],
.kfz-form input[type="email"],
.kfz-form input[type="tel"],
.kfz-form input[type="number"],
.kfz-form input[type="date"],
.kfz-form textarea,
.kfz-form select {
    width: 100%;
    padding: .65em .85em;
    border: 1px solid #d5d8dc;
    border-radius: 8px;
    font-size: .95em;
    font-family: inherit;
    color: #333;
    background: #fafbfc;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
}

.kfz-form input:focus,
.kfz-form textarea:focus,
.kfz-form select:focus {
    border-color: var(--kfz-primary);
    background: #fff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--kfz-primary) 15%, transparent);
    outline: none;
}

.kfz-form textarea {
    resize: vertical;
    min-height: 80px;
}

.kfz-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .8em center;
    padding-right: 2.2em;
}

/* ---- Checkboxes ---- */

.kfz-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: .6em;
    font-weight: 400;
    font-size: .9em;
    cursor: pointer;
    line-height: 1.5;
    color: #444;
    -webkit-tap-highlight-color: transparent;
}

.kfz-checkbox-label input[type="checkbox"] {
    margin-top: .22em;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    accent-color: var(--kfz-primary);
    cursor: pointer;
}

@media (max-width: 600px) {
    .kfz-checkbox-label input[type="checkbox"] {
        width: 26px;
        height: 26px;
        min-width: 26px;
        min-height: 26px;
        margin-top: .1em;
    }
}

.kfz-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: .4em;
}

.kfz-checkbox-group label {
    display: flex;
    align-items: center;
    gap: .5em;
    font-weight: 400;
    font-size: .9em;
    cursor: pointer;
}

.kfz-checkbox-group label input[type="checkbox"] {
    accent-color: var(--kfz-primary);
}

/* ---- Legal / Consent section ---- */

.kfz-legal-section {
    grid-column: 1 / -1;
    border-top: 1px solid #eaecef;
    margin-top: .8em;
    padding-top: 1.2em;
}

.kfz-field.kfz-legal {
    margin-bottom: .7em;
}

.kfz-legal a {
    color: var(--kfz-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}

.kfz-legal a:hover {
    opacity: .8;
    text-decoration-thickness: 2px;
}

.kfz-legal.kfz-field--error .kfz-checkbox-label {
    color: #c0392b;
}

.kfz-legal.kfz-field--error input[type="checkbox"] {
    outline: 2px solid #e74c3c;
    outline-offset: 1px;
    border-radius: 3px;
}

/* ---- CAPTCHA ---- */

.kfz-captcha {
    grid-column: 1 / -1;
    margin-top: .5em;
}

/* ---- Required hint ---- */

.kfz-required-hint {
    grid-column: 1 / -1;
    font-size: .82em;
    color: #888;
    margin-top: .2em;
}

/* ---- Submit ---- */

.kfz-submit {
    grid-column: 1 / -1;
    margin-top: .5em;
}

.kfz-btn {
    display: inline-block;
    background: var(--kfz-button);
    color: #fff;
    border: none;
    padding: .75em 2.5em;
    font-size: 1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s, transform .1s;
    letter-spacing: .02em;
}

.kfz-btn:hover {
    background: var(--kfz-button-hover);
    transform: translateY(-1px);
}

.kfz-btn:active {
    transform: translateY(0);
}

/* ---- Error messages ---- */

.kfz-errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #e74c3c;
    padding: 1em 1.2em;
    margin-bottom: 1.5em;
    border-radius: 8px;
}

.kfz-errors-heading {
    margin: 0 0 .4em;
    color: #991b1b;
    font-size: .95em;
}

.kfz-errors ul {
    margin: 0;
    padding: 0 0 0 1.2em;
    list-style: disc;
}

.kfz-errors li {
    margin-bottom: .3em;
    color: #c0392b;
    font-size: .9em;
}

.kfz-errors li:last-child {
    margin-bottom: 0;
}

/* ---- Field-level error ---- */

.kfz-field--error input,
.kfz-field--error textarea,
.kfz-field--error select {
    border-color: #e74c3c !important;
}

.kfz-field--error label {
    color: #c0392b;
}

.kfz-field-error {
    display: block;
    color: #c0392b;
    font-size: .82em;
    margin-top: .25em;
}

/* ---- Success message ---- */

.kfz-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #22c55e;
    padding: 1.2em 1.5em;
    border-radius: 8px;
    margin: 2em auto;
    max-width: 720px;
    font-size: 1em;
    line-height: 1.6;
    color: #166534;
}

/* ---- Closed / full event ---- */

.kfz-closed {
    background: #fef9c3;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    padding: 1.2em 1.5em;
    border-radius: 8px;
    margin: 2em auto;
    max-width: 720px;
    font-size: 1em;
    line-height: 1.6;
    color: #92400e;
}

/* ---- Event title / spots ---- */

.kfz-event-title {
    margin: 0 0 .2em;
    font-size: 1.3em;
    color: var(--kfz-primary);
}

.kfz-spots-remaining {
    font-size: .88em;
    color: #666;
    margin: 0 0 1.2em;
}
