/* ======================================================================
   Shared Modal-Styles  –  bp-modal / bp-help-btn
   Wird global über base.html.twig eingebunden.
   Seiten-spezifische Übersteuerungen liegen in den jeweiligen CSS-Dateien.
   ====================================================================== */

/* ---- Overlay ---- */
.bp-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bp-modal[hidden] {
    display: none;
}

.bp-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    cursor: pointer;
}

/* ---- Modal-Box (Standard: kompakt, scrollbar) ---- */
.bp-modal__box {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 92vw;
    max-width: 620px;
    max-height: 90vh;
    max-height: 90dvh; /* dvh = sichtbare Höhe ohne Browser-UI */
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

/* Modifier: volle Höhe + breite Box (z. B. PDF-Preview) */
.bp-modal__box--full {
    height: 90vh;
    height: 90dvh;
    max-width: 960px;
}

/* ---- Toolbar ---- */
.bp-modal__toolbar {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.55rem 1rem;
    background: #62B352;
    color: #fff;
    flex-shrink: 0;
}

.bp-modal__title {
    font-weight: 700;
    font-size: 0.95rem;
    flex: 1;
}

/* ---- Schließen-Button ---- */
.bp-modal__close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    transition: background 0.15s;
}

.bp-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ======================================================================
   Hilfe-Button  (? im grünen Kreis)
   ====================================================================== */

.bp-help-btn {
    position: absolute;
    top: 0.65rem;
    right: 0.75rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #62B352;
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.bp-help-btn:hover {
    background: #4A8C3D;
    transform: scale(1.08);
}

.bp-help-btn:focus-visible {
    outline: 3px solid #62B352;
    outline-offset: 2px;
}

/* ======================================================================
   Hilfe-Inhalt
   ====================================================================== */

.bp-help-content {
    padding: 1.4rem 1.8rem 2rem;
    overflow-y: auto;
    flex: 1;
    font-size: 0.94rem;
    line-height: 1.65;
    color: #333;
}

/* Scrollbarer Inhaltsbereich in Modals (ohne Hilfe-Typografie) */
.bp-modal__body {
    padding: 1.4rem 1.8rem;
    overflow-y: auto;
    flex: 1;
}

/* ---- Hilfe-Inhalt: Typografie (einheitlich) ---- */

.bp-help-content h2 {
    font-size: 1.1rem;
    color: #4A8C3D;
    border-bottom: 2px solid #c8e6c9;
    padding-bottom: 0.3rem;
    margin: 1.6rem 0 0.6rem;
}

.bp-help-content h2:first-child {
    margin-top: 0;
}

.bp-help-content h3 {
    font-size: 0.97rem;
    color: #2e5e26;
    margin: 1.1rem 0 0.35rem;
}

.bp-help-content p {
    margin: 0.4rem 0 0.8rem;
}

.bp-help-content ol,
.bp-help-content ul {
    padding-left: 1.3rem;
    margin: 0.4rem 0 0.8rem;
}

.bp-help-content li {
    margin-bottom: 0.3rem;
}

.bp-help-content code {
    background: #f0f4f0;
    border: 1px solid #d0ddd0;
    border-radius: 3px;
    padding: 0.05em 0.35em;
    font-size: 0.9em;
    font-family: monospace;
}

/* ---- Hilfe-Tabelle ---- */
.bp-help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin: 0.5rem 0 1rem;
}

.bp-help-table th,
.bp-help-table td {
    text-align: left;
    padding: 0.45rem 0.65rem;
    border: 1px solid #dde8dd;
    vertical-align: top;
}

.bp-help-table thead th {
    background: #e8f5e9;
    font-weight: 600;
    color: #2e5e26;
}

.bp-help-table tbody tr:nth-child(even) {
    background: #f6fbf5;
}

/* ---- Hilfe-Farblegende ---- */
.bp-help-legend {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.4rem;
    margin: 0.4rem 0 0.8rem;
}

.bp-help-legend li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
}

.bp-help-legend__color {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.12);
    flex-shrink: 0;
}

@media (max-width: 500px) {
    .bp-modal__box {
        width: 100vw;
        max-width: 100vw;
        max-height: 85vh;
        max-height: 85dvh;
        border-radius: 12px 12px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
    }
    /* Overlay zentriert nicht mehr, sondern ausrichten nach unten */
    .bp-modal {
        align-items: flex-end;
        justify-content: stretch;
    }
    .bp-modal__toolbar {
        padding: 0.4rem 0.75rem;
    }
    .bp-modal__body {
        padding: 1rem 1rem;
    }
    .bp-help-content {
        padding: 1rem 1rem 1.5rem;
    }

    .bp-help-table {
        font-size: 0.82rem;
    }

    .bp-help-legend {
        gap: 0.4rem 0.8rem;
    }
}

/* ============================================================
   Feedback-Button im Footer
   ============================================================ */
.feedback-footer-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 12px;
    padding: 3px 11px 3px 9px;
    background: #62b352;
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 10pt;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    vertical-align: middle;
}
.feedback-footer-btn:hover {
    background: #4a8c3d;
}

/* ============================================================
   Feedback-Modal Box (etwas schmaler als der Standard)
   ============================================================ */
.feedback-modal__box {
    max-width: 560px;
}

/* ============================================================
   Feedback-Formular
   ============================================================ */
.feedback-intro {
    margin: 0 0 18px;
    color: #444;
    font-size: 10.5pt;
    line-height: 1.5;
}
.feedback-form-wrap {
    padding: 20px 24px 22px;
}
.feedback-field {
    margin-bottom: 16px;
}
.feedback-label {
    display: block;
    font-size: 10pt;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}
.feedback-required {
    color: #c00;
}
.feedback-select-wrap {
    position: relative;
}
.feedback-select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 10.5pt;
    font-family: inherit;
    background: #fff;
    color: #222;
    appearance: none;
    cursor: pointer;
}
.feedback-select:focus {
    outline: 2px solid #62b352;
    border-color: #62b352;
}
.feedback-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 10.5pt;
    font-family: inherit;
    resize: vertical;
    min-height: 110px;
    box-sizing: border-box;
    color: #222;
}
.feedback-textarea:focus {
    outline: 2px solid #62b352;
    border-color: #62b352;
}
.feedback-textarea--error {
    border-color: #c00;
    outline: 2px solid #c00;
}
.feedback-charcount {
    text-align: right;
    font-size: 9pt;
    color: #888;
    margin-top: 3px;
}
.feedback-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 10.5pt;
    font-family: inherit;
    box-sizing: border-box;
    color: #222;
}
.feedback-input:focus {
    outline: 2px solid #62b352;
    border-color: #62b352;
}
.feedback-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.feedback-submit-btn {
    padding: 8px 22px;
    background: #62b352;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 10.5pt;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}
.feedback-submit-btn:hover:not(:disabled) {
    background: #4a8c3d;
}
.feedback-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.feedback-cancel-btn {
    padding: 8px 18px;
    background: transparent;
    color: #555;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 10.5pt;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.feedback-cancel-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}
.feedback-result {
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 10.5pt;
    margin-bottom: 16px;
}
.feedback-result--ok {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.feedback-result--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
/* Nach erfolgreichem Absenden Formular ausblenden */
.feedback-form--sent .feedback-field,
.feedback-form--sent .feedback-actions {
    display: none;
}

/* ============================================================
   Datenschutz-Modal
   ============================================================ */
.datenschutz-modal__box {
    max-width: 700px;
}

.datenschutz-content {
    padding: 1.4rem 1.8rem 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Abschnitte – identisches Design wie Impressum */
.dsm-section {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.dsm-section--last {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.dsm-section h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.75rem;
}

.dsm-section p {
    margin: 0 0 0.75rem;
    line-height: 1.7;
    color: #444;
}

.dsm-section address {
    font-style: normal;
    line-height: 1.8;
    margin-bottom: 1.25rem;
    color: #444;
}

.dsm-section address a {
    color: #1976d2;
    text-decoration: none;
}

.dsm-section address a:hover {
    text-decoration: underline;
}

/* Footer-Link als unsichtbarer Inline-Button */
.privacy-footer-btn {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
