/* ==========================================================================
   Beratungskalender – Frontend Styles
   ========================================================================== */

/* Honeypot: visuell versteckt, aber nicht display:none (würde Bots verraten) */
.wpk-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    tab-index: -1;
}

.wpk-app {
    max-width: 680px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a1a;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Schritte-Anzeige
   -------------------------------------------------------------------------- */

.wpk-steps {
    display: flex;
    align-items: center;
    margin-bottom: 32px;
    gap: 0;
}

.wpk-step {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.wpk-step:not(:last-child)::after {
    content: '';
    flex: 1;
    height: 2px;
    background: #ddd;
    margin: 0 8px;
}

.wpk-step--active {
    opacity: 1;
}

.wpk-step--completed {
    opacity: 0.75;
}

.wpk-step__num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #555;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.wpk-step--active .wpk-step__num {
    background: var(--wpk-step-circle-bg, #0078d4);
    color: var(--wpk-step-circle-text, #fff);
}

.wpk-step--completed .wpk-step__num {
    background: #107c10;
    color: #fff;
}

.wpk-step__label {
    font-size: 13px;
    color: #444;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Panel
   -------------------------------------------------------------------------- */

.wpk-panel {
    animation: wpkFadeIn 0.22s ease;
}

.wpk-panel--hidden {
    display: none !important;
}

@keyframes wpkFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wpk-panel__title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px;
    color: #1a1a1a;
}

.wpk-back {
    background: none;
    border: none;
    color: var(--wpk-color-primary, #0078d4);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.wpk-back:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Kalender
   -------------------------------------------------------------------------- */

.wpk-cal {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.wpk-cal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--wpk-color-primary, #0078d4);
    color: #fff;
}

.wpk-cal__title {
    font-weight: 600;
    font-size: 16px;
}

.wpk-cal__nav {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.wpk-cal__nav:hover {
    background: rgba(255,255,255,0.15);
}

.wpk-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 8px;
    gap: 2px;
}

.wpk-cal__day-name {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    padding: 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wpk-cal__day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
    cursor: default;
    color: #bbb;
}

.wpk-cal__day--available {
    color: #1a1a1a;
    cursor: pointer;
    font-weight: 500;
}

.wpk-cal__day--available:hover {
    background: #e8f0fe;
    color: var(--wpk-color-primary, #0078d4);
}

.wpk-cal__day--disabled {
    color: #ccc;
    text-decoration: line-through;
    opacity: 0.5;
}

.wpk-cal__day--today {
    border: 2px solid var(--wpk-color-primary, #0078d4);
    font-weight: 700;
}

.wpk-cal__day--selected {
    background: var(--wpk-color-primary, #0078d4) !important;
    color: #fff !important;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Slots
   -------------------------------------------------------------------------- */

.wpk-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wpk-slot {
    padding: 10px 18px;
    border: 2px solid var(--wpk-color-primary, #0078d4);
    border-radius: 6px;
    background: #fff;
    color: var(--wpk-color-primary, #0078d4);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.wpk-slot:hover,
.wpk-slot--selected {
    background: var(--wpk-color-primary, #0078d4);
    color: #fff;
}

.wpk-loading,
.wpk-no-slots {
    color: #666;
    font-style: italic;
    padding: 20px 0;
}

.wpk-no-slots {
    color: #c0392b;
}

/* --------------------------------------------------------------------------
   Formular
   -------------------------------------------------------------------------- */

.wpk-summary-line {
    background: #f0f6ff;
    border-left: 3px solid var(--wpk-color-primary, #0078d4);
    padding: 10px 14px;
    border-radius: 0 4px 4px 0;
    margin-bottom: 24px;
    font-size: 14px;
}

.wpk-field {
    margin-bottom: 18px;
}

.wpk-field label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 6px;
    color: #333;
}

.wpk-field input[type="text"],
.wpk-field input[type="email"],
.wpk-field input[type="tel"],
.wpk-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    font-family: inherit;
    background: #fff;
    color: #1a1a1a;
}

.wpk-field input:focus,
.wpk-field textarea:focus {
    outline: none;
    border-color: var(--wpk-color-primary, #0078d4);
    box-shadow: 0 0 0 3px rgba(0,120,212,0.12);
}

.wpk-field textarea {
    resize: vertical;
    min-height: 80px;
}

.wpk-field--checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    cursor: pointer;
}

.wpk-field--checkbox input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.wpk-required {
    color: #c0392b;
}

.wpk-optional {
    color: #999;
    font-size: 12px;
    font-weight: 400;
}

/* Fehlerhafte Felder (z.B. Telefonnummer) bekommen einen roten Rand –
   zusaetzlich zur Fehlermeldung, damit der Fehler auch beim schnellen
   Ueberfliegen des Formulars auffaellt. */
.wpk-field input.wpk-field-error,
.wpk-field input.wpk-field-error:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192,57,43,0.12);
}

.wpk-field-error-msg {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #c0392b;
}

.wpk-field--radio {
    border: none;
    margin: 0 0 18px;
    padding: 0;
}

.wpk-field--radio legend {
    display: block;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 6px;
    color: #333;
    padding: 0;
}

.wpk-radio-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    margin-right: 20px;
    cursor: pointer;
}

.wpk-radio-option input[type="radio"] {
    cursor: pointer;
}

/* Buttons */

.wpk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background 0.15s, opacity 0.15s;
    gap: 8px;
}

.wpk-btn--primary {
    background: var(--wpk-color-primary, #0078d4);
    color: #fff;
    width: 100%;
    margin-top: 8px;
}

.wpk-btn--primary:hover:not(:disabled) {
    /* Abdunkeln unabhaengig von der konfigurierten Farbe – ohne das waere
       fuer jede moegliche Primaerfarbe ein eigener Hover-Wert noetig. */
    filter: brightness(0.85);
}

.wpk-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* Alert */

.wpk-alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.wpk-alert--error {
    background: #fdf0f0;
    border: 1px solid #f5c6c6;
    color: #c0392b;
}

/* --------------------------------------------------------------------------
   Bestaetigung
   -------------------------------------------------------------------------- */

.wpk-confirmation {
    text-align: center;
    padding: 40px 20px;
}

.wpk-confirmation__icon {
    width: 64px;
    height: 64px;
    background: #107c10;
    color: #fff;
    border-radius: 50%;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.wpk-confirmation h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.wpk-confirmation p {
    color: #444;
    font-size: 16px;
    max-width: 480px;
    margin: 0 auto 16px;
}

#wpk-confirm-text {
    /* Der Text kommt aus dem Backend und kann mehrzeilig sein */
    white-space: pre-line;
}

.wpk-confirm-email-note {
    font-size: 14px !important;
    color: #666 !important;
}

/* --------------------------------------------------------------------------
   Kostenhinweis
   -------------------------------------------------------------------------- */

.wpk-cost-notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #fff8e6;
    border: 1px solid #f0d48a;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 0 0 24px;
}

.wpk-cost-notice__icon {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #dba617;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    line-height: 26px;
    text-align: center;
}

.wpk-cost-notice p {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.55;
    color: #5c4708;
}

.wpk-cost-notice p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Terminart
   -------------------------------------------------------------------------- */

.wpk-field__label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 15px;
}

.wpk-types {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.wpk-type-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex: 1 1 160px;
    padding: 18px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.wpk-type-card:hover {
    border-color: var(--wpk-color-primary, #0078d4);
    box-shadow: 0 2px 8px rgba(0, 120, 212, .12);
}

.wpk-type-card:focus-visible {
    outline: 2px solid var(--wpk-color-primary, #0078d4);
    outline-offset: 2px;
}

.wpk-type-card--selected {
    border-color: var(--wpk-color-primary, #0078d4);
    background: #f0f7ff;
}

.wpk-type-card__name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.wpk-type-card__meta {
    font-size: 13px;
    color: #666;
}

/* Hinweis unter dem Absenden-Button: der Termin ist erst eine Anfrage */
.wpk-submit-note {
    font-size: 13px;
    color: #666;
    margin: 10px 0 0;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
    .wpk-step__label {
        display: none;
    }

    .wpk-cal__grid {
        gap: 1px;
        padding: 4px;
    }

    .wpk-cal__day {
        font-size: 13px;
    }

    .wpk-slot {
        padding: 9px 14px;
        font-size: 14px;
    }

    .wpk-btn--primary {
        padding: 13px 20px;
    }
}
