/**
 * Erstberatung-Modal — Design nach Claude-Design-Vorlage (Plus Jakarta Sans, var(--accent, #2755A2)).
 * Step 1 = Anliegen-Auswahl (1:1 Design). Step 2 = echtes Cal.com-Embed im Design-Rahmen.
 *
 * @package GeneratePress Child
 */

@keyframes ebm-pop { 0% { opacity: 0; transform: translateY(16px) scale(.97); } 100% { opacity: 1; transform: translateY(0) scale(1); } }

/* Overlay */
.ebm {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 27, 46, .55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.ebm.is-open { display: flex; }

.ebm,
.ebm * {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
}

/* Alle Modal-Icons sind Linien-Icons (Lucide): gegen globale svg-Regeln absichern */
.ebm svg {
    fill: none;
    stroke: currentColor;
}

/* Dialog */
.ebm__dialog {
    position: relative;
    width: 100%;
    max-width: 880px;
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 32px 80px -20px rgba(15, 27, 46, .55), 0 0 0 1px rgba(255, 255, 255, .06);
    animation: ebm-pop .22s cubic-bezier(.16, 1, .3, 1);
}

.ebm__dialog::-webkit-scrollbar { width: 8px; }
.ebm__dialog::-webkit-scrollbar-thumb { background: #d3dae6; border-radius: 8px; }
.ebm__dialog::-webkit-scrollbar-track { background: transparent; }

/* Close */
.ebm__close {
    position: absolute;
    top: 22px;
    right: 22px;
    z-index: 5;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: #f1f4f9;
    color: #64748b !important; /* Theme-Button-Farbe (z. B. Weiß) überschreiben */
    cursor: pointer;
    transition: background-color .18s, color .18s;
}

.ebm__close:hover,
.ebm__close:focus-visible {
    background: var(--accent, #2755A2) !important;
    color: #fff;
    outline: none;
}

.ebm__close svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: none !important;
    stroke: currentColor !important; /* gegen globale svg-Regeln des Themes */
}

/* ---------- STEP 1 ---------- */
.ebm__step1 { padding: 44px 44px 32px; }

.ebm__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

/* Echtes Brand-Logo (477×130) – Höhe begrenzt, Seitenverhältnis bleibt */
.ebm__brand-logo {
    height: 38px;
    width: auto;
    max-width: 100%;
    display: block;
}

.ebm__brand-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--accent, #2755A2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ebm__brand-icon svg { width: 15px; height: 15px; color: #fff; }

.ebm__brand-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent, #2755A2);
    letter-spacing: .2px;
}

.ebm__title {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    color: #1a2436;
    letter-spacing: -.8px;
    line-height: 1.15;
}

.ebm__subtitle {
    margin: 12px 0 32px;
    font-size: 16px;
    color: #64748b;
    line-height: 1.5;
    max-width: 560px;
}

.ebm__choices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.ebm__choice {
    text-align: left;
    background: #fff;
    border: 1.5px solid #e7ecf3;
    border-radius: 18px;
    padding: 24px 22px 20px;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    min-height: 220px;
    transition: transform .2s cubic-bezier(.16, 1, .3, 1), border-color .2s, box-shadow .2s;
}

.ebm__choice:hover,
.ebm__choice:focus-visible {
    transform: translateY(-5px);
    background: var(--accent, #2755A2) !important; /* überschreibt Theme-Button-Hover (grau) */
    border-color: var(--accent, #2755A2);
    box-shadow: 0 18px 36px -14px rgba(39, 85, 162, .4);
    outline: none;
}

/* Inhalte auf der gefüllten Karte gut lesbar machen */
.ebm__choice:hover .ebm__choice-title,
.ebm__choice:focus-visible .ebm__choice-title,
.ebm__choice:hover .ebm__choice-desc,
.ebm__choice:focus-visible .ebm__choice-desc,
.ebm__choice:hover .ebm__choice-cta,
.ebm__choice:focus-visible .ebm__choice-cta {
    color: #fff;
}

.ebm__choice:hover .ebm__choice-icon,
.ebm__choice:focus-visible .ebm__choice-icon {
    background: rgba(255, 255, 255, .18);
}

.ebm__choice:hover .ebm__choice-icon svg,
.ebm__choice:focus-visible .ebm__choice-icon svg {
    color: #fff;
}

.ebm__choice-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #eef4fc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.ebm__choice-icon svg { width: 26px; height: 26px; color: var(--accent, #2755A2); }

.ebm__choice-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a2436;
    letter-spacing: -.3px;
    margin-bottom: 7px;
}

.ebm__choice-desc {
    font-size: 14px;
    color: #6b7888;
    line-height: 1.5;
    flex: 1;
}

.ebm__choice-cta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 18px;
    color: var(--accent, #2755A2);
    font-size: 14px;
    font-weight: 700;
}

.ebm__choice-cta svg { width: 16px; height: 16px; }

.ebm__trust {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid #eef1f5;
}

.ebm__trust-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7888;
    font-size: 13.5px;
    font-weight: 500;
}

.ebm__trust-left svg { width: 17px; height: 17px; color: #1f9d57; }

.ebm__trust-phone {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1a2436;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
}

.ebm__trust-phone svg { width: 16px; height: 16px; color: var(--accent, #2755A2); }

/* ---------- STEP 2 ---------- */
.ebm__step2 { padding: 24px 36px 32px; }

.ebm__back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent !important; /* kein Theme-Button-Hintergrund */
    border: none;
    color: var(--accent, #2755A2);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 10px 8px 0;
    margin-bottom: 14px;
    transition: opacity .18s;
}

.ebm__back:hover,
.ebm__back:focus-visible { opacity: .7; outline: none; }

.ebm__back svg { width: 17px; height: 17px; }

.ebm__cal-frame {
    border: 1px solid #e7ecf3;
    border-radius: 20px;
    overflow: hidden;
    padding: 8px;
}

.ebm__cal {
    min-height: 62vh;
}

.ebm__cal iframe { width: 100% !important; border: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .ebm__choices { grid-template-columns: 1fr; }
    .ebm__choice { min-height: 0; }
}

@media (max-width: 600px) {
    .ebm { padding: 14px; }
    .ebm__dialog { border-radius: 18px; }
    .ebm__step1 { padding: 34px 22px 24px; }
    .ebm__step2 { padding: 20px 18px 24px; }
    .ebm__title { font-size: 24px; }
    .ebm__subtitle { font-size: 15px; margin-bottom: 24px; }
    .ebm__cal { min-height: 70vh; }
    .ebm__brand-logo { height: 32px; }
}

/* ----------------------------------------------------------------------
   Overrides gegen Theme-Button-Styles (höhere Spezifität über die Modal-ID).
   Lösen zwei Probleme:
   1) Close-"X" unsichtbar, weil das Theme die Button-/SVG-Farbe auf Weiß zwingt.
   2) "Anliegen ändern" wird beim Hover weiß (Theme button:hover) → auf weißem
      Grund unsichtbar.
   ---------------------------------------------------------------------- */

/* Close-X: Größe + Stroke-Farbe erzwingen (Theme drückt die SVG-Breite auf 0) */
#erstberatung-modal .ebm__close svg {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    flex-shrink: 0;
    display: block;
    stroke: #64748b !important;
    fill: none !important;
}

#erstberatung-modal .ebm__close:hover svg,
#erstberatung-modal .ebm__close:focus-visible svg {
    stroke: #fff !important;
}

/* "Anliegen ändern": Farbe fix auf Accent, auch im Hover/Focus */
#erstberatung-modal .ebm__back,
#erstberatung-modal .ebm__back:hover,
#erstberatung-modal .ebm__back:focus-visible {
    color: var(--accent, #2755A2) !important;
}
