/* ==========================================================================
   KrebsCheck Fragebogen – Styles
   ========================================================================== */

.krebscheck-plugin {
    --color-primary:      #00022e;
    --color-surface:      #fffaf4;
    --color-accent:       #dbc6b2;
    --color-text:         #000022;
    --color-text-muted:   #95949c;
    --color-bg:           #ffffff;
    --color-border:       #dbc6b2;
    --radius:             12px;
    --radius-sm:          8px;
    --shadow:             0 2px 12px rgba(0, 2, 46, 0.06);
    --transition:         0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast:    0.2s ease;

    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--color-text);
    width: 100%;
    box-sizing: border-box;
}

.krebscheck-plugin *, .krebscheck-plugin *::before, .krebscheck-plugin *::after { box-sizing: border-box; }

/* ---------- Progress bar ---------- */

.kc-progress-wrap { width: 100%; padding: 0 20px 12px; transition: opacity 0.4s ease; }
.kc-progress-track { height: 6px; background: var(--color-border); border-radius: 999px; overflow: hidden; }
.kc-progress-fill { height: 100%; background: var(--color-primary); border-radius: 999px; transition: width var(--transition-fast); }

/* ---------- Form header ---------- */

.kc-form-header {
    text-align: center;
    padding: 0 20px;
    margin-bottom: 8px;
}

.kc-form-title {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(1.4rem, 4.5vw, 1.75rem);
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 6px;
    line-height: 1.25;
}

.kc-form-subtitle {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ---------- Form wrapper & steps ---------- */

.kc-form-wrap {
    width: 100%;
    padding: 16px 20px 24px;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    margin-top: 25px;
}

.kc-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.kc-step {
    position: absolute; top: 0; left: 0; right: 0; width: 100%;
    opacity: 0; visibility: hidden; transform: translateX(24px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
    pointer-events: none;
}

.kc-step.active {
    position: relative; opacity: 1; visibility: visible;
    transform: translateX(0); pointer-events: auto; width: 100%;
}

.kc-step.slide-out-left { transform: translateX(-24px); }
.kc-step.slide-in-right { transform: translateX(24px); }

/* ---------- Step typography ---------- */

.kc-step-title {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    font-weight: 800; line-height: 1.3;
    color: var(--color-primary); text-align: center;
    margin: 0 0 16px;
}

@media (min-width: 480px) { .kc-step-title { margin-bottom: 20px; } }

/* ---------- Radio options ---------- */

.kc-options-grid {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px; margin-bottom: 16px;
}

.kc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kc-grid-col { flex-direction: column; }

.kc-option {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 100%; min-height: 56px; padding: 16px 20px;
    background: var(--color-surface); border: 2px solid var(--color-border); border-radius: var(--radius);
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.kc-option:hover { border-color: var(--color-primary); background: rgba(219, 198, 178, 0.3); }
.kc-option:active { transform: scale(0.98); }
.kc-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.kc-option:has(input:checked) { border-color: var(--color-primary); background: rgba(219, 198, 178, 0.4); box-shadow: var(--shadow); }
.kc-option:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.kc-option-inner { display: flex; align-items: center; justify-content: center; width: 100%; border: none; background: none; padding: 0; }
.kc-option-label { font-size: 0.9rem; font-weight: 500; text-align: center; color: var(--color-text); line-height: 1.4; text-transform: none !important; letter-spacing: normal !important; }

/* ---------- Checkbox groups ---------- */

.kc-check-group { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.kc-check-item {
    display: flex; align-items: center; gap: 12px;
    width: 100%; min-height: 52px; padding: 14px 20px;
    background: var(--color-surface); border: 2px solid var(--color-border); border-radius: var(--radius);
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.kc-check-item:hover { border-color: var(--color-primary); background: rgba(219, 198, 178, 0.3); }
.kc-check-item.is-checked { border-color: var(--color-primary); background: rgba(219, 198, 178, 0.4); box-shadow: var(--shadow); }
.kc-check-input { position: absolute; opacity: 0; width: 0; height: 0; }

.kc-check-box {
    width: 20px; height: 20px;
    border: 2px solid var(--color-border); border-radius: 4px;
    flex-shrink: 0; background: var(--color-bg);
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.kc-check-item.is-checked .kc-check-box { background: var(--color-primary); border-color: var(--color-primary); }
.kc-check-item.is-checked .kc-check-box::after {
    content: ''; width: 10px; height: 6px;
    border-left: 2px solid #fff; border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px); display: block;
}

.kc-check-label { font-size: 0.9rem; font-weight: 500; line-height: 1.4; color: var(--color-text); text-transform: none !important; letter-spacing: normal !important; }
.kc-loading { font-size: 0.875rem; color: var(--color-text-muted); padding: 8px 0; text-align: center; }

/* ---------- Buttons (scoped to override Elementor/theme globals) ---------- */

.krebscheck-plugin button::before,
.krebscheck-plugin button::after,
.krebscheck-plugin a.kc-btn::before,
.krebscheck-plugin a.kc-btn::after {
    all: initial !important;
    content: none !important;
    display: none !important;
}

.krebscheck-plugin .kc-btn {
    display: flex; align-items: center; justify-content: center;
    padding: 12px 20px; font-size: 1rem; font-weight: 600; font-family: inherit;
    border-radius: var(--radius-sm); border: 2px solid transparent; cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
    -webkit-tap-highlight-color: transparent; -webkit-appearance: none; appearance: none;
    text-decoration: none !important; line-height: 1; outline: none;
    background-image: none;
}

.krebscheck-plugin .kc-btn::-moz-focus-inner { border: 0; }
.krebscheck-plugin .kc-btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.krebscheck-plugin .kc-btn-primary,
.krebscheck-plugin .kc-btn-next {
    background: var(--color-primary) !important; color: var(--color-surface) !important; border-color: var(--color-primary) !important;
    width: 100%; max-width: 320px; margin: 8px auto 0;
}

.krebscheck-plugin .kc-btn-primary:hover,
.krebscheck-plugin .kc-btn-next:hover {
    background: var(--color-bg) !important; color: var(--color-primary) !important; border-color: var(--color-primary) !important;
}

.krebscheck-plugin .kc-btn:disabled { opacity: 0.35; cursor: default; pointer-events: none; }

.krebscheck-plugin .kc-btn-back { background: transparent !important; color: var(--color-text-muted) !important; border-color: transparent !important; padding: 10px 0; font-size: 0.875rem; }
.krebscheck-plugin .kc-btn-back:hover { color: var(--color-primary) !important; }

.kc-nav { margin-top: 12px; text-align: center; }

/* ==========================================================================
   RESULT — clean single-column
   ========================================================================== */

.kc-result {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 32px 20px 24px;
    text-align: center;
}

/* Score label */
.kc-score-label {
    font-family: 'Open Sans', -apple-system, sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.kc-score-label b {
    font-weight: 800;
    color: var(--color-primary);
}

/* Score */
.kc-score-display {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 8px;
    line-height: 1;
}

.kc-score-num {
    font-family: 'Open Sans', -apple-system, sans-serif;
    font-size: 5rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    letter-spacing: -3px;
}

.kc-score-pct {
    font-family: 'Open Sans', -apple-system, sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-top: 12px;
    margin-left: 2px;
}

/* How-is-it-calculated toggle */
.krebscheck-plugin .kc-how-link {
    display: block;
    font-size: 0.7rem;
    color: var(--color-text-muted) !important;
    text-decoration: underline !important;
    text-underline-offset: 2px;
    cursor: pointer;
    margin-bottom: 28px;
}

.krebscheck-plugin .kc-how-link:hover { color: var(--color-text) !important; }

.kc-how-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, margin 0.3s ease;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-top: -20px;
    margin-bottom: 0;
}

.kc-how-detail.is-open {
    max-height: 300px;
    margin-bottom: 28px;
}

/* Funnel block */
.kc-funnel {
    margin-top: 28px;
    margin-bottom: 28px;
    background: var(--color-primary);
    border-radius: var(--radius);
    padding: 28px 24px 24px;
    text-align: center;
}

.kc-funnel-msg {
    font-family: 'Open Sans', -apple-system, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
    margin-bottom: 20px;
}

/* Recs heading */
.kc-recs-heading {
    font-family: 'Open Sans', -apple-system, sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    text-align: left;
    margin-top: 16px;
    margin-bottom: 6px;
}

.kc-recs-subtext {
    font-size: 0.775rem;
    color: var(--color-text-muted);
    text-align: left;
    line-height: 1.5;
    margin-bottom: 12px;
}

/* Recommendations — expandable rows */
.kc-recs-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    text-align: left;
    margin-bottom: 32px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.kc-rec-item {
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.kc-rec-item:last-child {
    border-bottom: none;
}

.kc-rec-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--color-surface);
    transition: background var(--transition-fast);
}

.kc-rec-item:hover .kc-rec-item-header {
    background: rgba(219, 198, 178, 0.25);
}

.kc-rec-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    flex: 1;
}

.kc-rec-item-badge {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--color-text-muted);
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.kc-rec-item-chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    position: relative;
    transition: transform var(--transition-fast);
}

.kc-rec-item-chevron::before,
.kc-rec-item-chevron::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 7px;
    height: 1.5px;
    background: var(--color-text-muted);
    border-radius: 1px;
    transition: transform var(--transition-fast);
}

.kc-rec-item-chevron::before {
    left: 2px;
    transform: translateY(-50%) rotate(40deg);
}

.kc-rec-item-chevron::after {
    right: 2px;
    transform: translateY(-50%) rotate(-40deg);
}

.kc-rec-item.is-open .kc-rec-item-chevron::before {
    transform: translateY(-50%) rotate(-40deg);
}

.kc-rec-item.is-open .kc-rec-item-chevron::after {
    transform: translateY(-50%) rotate(40deg);
}

.kc-rec-item-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.kc-rec-item.is-open .kc-rec-item-detail {
    max-height: 300px;
}

.kc-rec-item-meta {
    padding: 4px 18px 16px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    line-height: 1.65;
}

.kc-rec-item-meta b {
    color: var(--color-text);
    font-weight: 600;
}

.krebscheck-plugin .kc-rec-item-meta a {
    display: inline-block;
    color: var(--color-primary) !important;
    text-decoration: none !important;
    font-weight: 500;
    margin-top: 6px;
}

.krebscheck-plugin .kc-rec-item-meta a:hover {
    text-decoration: underline !important;
}

.kc-recs-empty {
    padding: 20px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-align: center;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 32px;
}

/* CTA button */
.krebscheck-plugin .kc-btn-cta {
    background: #fff !important;
    color: var(--color-primary) !important;
    border-color: #fff !important;
    padding: 16px 28px;
    font-size: 1.05rem;
    font-weight: 700;
    width: 100%;
    text-decoration: none !important;
    border-radius: var(--radius);
}

.krebscheck-plugin .kc-btn-cta:hover {
    background: rgba(255,255,255,0.88) !important;
    color: var(--color-primary) !important;
    border-color: rgba(255,255,255,0.88) !important;
}

/* Phase 2: Risk step */
.kc-risk-step {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 32px 20px 24px;
}

/* Phase 2: Risk result cards */
.kc-risk-card {
    text-align: center;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 12px;
}

.kc-risk-card-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.kc-risk-card-value {
    font-family: 'Open Sans', -apple-system, sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
}

.kc-risk-card-high {
    background: #fdf6f5;
    border-color: #e8ccc7;
}

.kc-risk-card-high .kc-risk-card-value {
    color: #a02020;
}

.kc-risk-card-ok {
    background: #e8f5f0;
    border-color: #b8dfd0;
}

.kc-risk-card-ok .kc-risk-card-value {
    color: #1a5c3a;
}

/* Info toggle (ⓘ) */
.krebscheck-plugin .kc-info-toggle {
    font-size: 0.75rem;
    color: var(--color-text-muted) !important;
    cursor: pointer;
    text-decoration: none !important;
    margin-left: 2px;
}

.krebscheck-plugin .kc-info-toggle:hover {
    color: var(--color-text) !important;
}

.kc-info-detail {
    display: none;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-top: 10px;
}

.kc-info-detail.is-open {
    display: block;
}

/* Risk factor summary */
.kc-risk-summary {
    text-align: left;
    margin-top: 16px;
    margin-bottom: 20px;
    padding: 16px 18px;
    background: #fdf6f5;
    border: 1.5px solid #e8ccc7;
    border-radius: var(--radius);
    line-height: 1.8;
}

.kc-risk-summary-label {
    font-family: 'Open Sans', -apple-system, sans-serif;
    font-weight: 700;
    color: #8a3a2a;
    display: block;
    margin-bottom: 10px;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.kc-risk-tag {
    display: inline-block;
    background: #fff;
    border: 1.5px solid #dbb8b0;
    border-radius: 6px;
    padding: 4px 11px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b2a1e;
    margin: 0 6px 6px 0;
}

/* Secondary CTA (bottom) */
.krebscheck-plugin .kc-btn-secondary {
    background: var(--color-primary) !important;
    color: var(--color-surface) !important;
    border-color: var(--color-primary) !important;
    padding: 16px 28px;
    font-size: 1rem;
    font-weight: 700;
    width: 100%;
    text-decoration: none !important;
    border-radius: var(--radius);
    margin-bottom: 32px;
}

.krebscheck-plugin .kc-btn-secondary:hover {
    background: var(--color-bg) !important;
    color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
}

/* Footer */
.kc-result-footer {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.krebscheck-plugin .kc-result-footer a {
    color: var(--color-text-muted) !important;
    text-decoration: underline !important;
    cursor: pointer;
}

.krebscheck-plugin .kc-result-footer a:hover {
    color: var(--color-text) !important;
}

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

@media (min-width: 480px) {
    .kc-form-wrap { padding: 20px 24px 24px; }
    .kc-progress-wrap { padding: 0 24px 14px; }
}

/* ---------- Hide Doctolib floating button on mobile ---------- */

@media (max-width: 768px) {
    #doclib { display: none !important; }
}

/* ---------- Contact form ---------- */

.krebscheck-plugin .kc-contact-field {
    margin-bottom: 20px;
}

.krebscheck-plugin .kc-field-label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--color-text);
}

.krebscheck-plugin .kc-text-input {
    width: 100%;
    max-width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
    height: auto;
    line-height: normal;
    margin: 0;
}

.krebscheck-plugin .kc-text-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: none;
}

.krebscheck-plugin .kc-text-input::placeholder {
    color: var(--color-text-muted);
    opacity: 1;
}

.krebscheck-plugin .kc-contact-error {
    color: #a02020;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.krebscheck-plugin .kc-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .kc-step, .kc-option, .kc-check-item, .kc-btn, .kc-progress-fill, .kc-rec-item-detail {
        transition-duration: 0.01ms !important;
    }
}
