/**
 * Idee Einreichen Overlay & Floating Action Button (FAB)
 * Beteiligungsplattform
 */

/* ==========================================================================
   1. Floating Action Button (FAB)
   ========================================================================== */
#ihmert-fab {
    position: fixed;
    right: 48px;
    bottom: 40px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 156px;
    height: 156px;
    padding: 0;
    background: #25662a;
    color: #ffffff !important;
    font-family: var(--body_typography-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    text-decoration: none !important;
    border-radius: 50%;
    border: 4px solid #ffffff;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.35s cubic-bezier(0.34, 1.25, 0.64, 1);
    will-change: transform, box-shadow, width, height, border-radius;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

#ihmert-fab:hover {
    background: #215925;
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.38);
    color: #ffffff !important;
}

#ihmert-fab:active {
    transform: translateY(-2px) scale(0.98);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* Plus Badge at top-right */
.ihmert-fab-badge-plus {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f4eee2;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #245e2a;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
    opacity: 1;
    transform: scale(1);
}

.ihmert-fab-badge-plus svg {
    width: 20px;
    height: 20px;
    stroke: #245e2a;
}

/* "Mach mit!" Note with Arrow */
.ihmert-fab-note-wrap {
    position: absolute;
    left: -110px;
    top: -18px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    opacity: 1;
    transform: translateY(0);
}

.ihmert-fab-note-text {
    font-family: 'Caveat', 'Kalam', 'Segoe Print', cursive, sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #ea580c;
    line-height: 1;
    transform: rotate(-10deg);
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(255, 255, 255, 0.25);
}

.ihmert-fab-note-arrow {
    width: 44px;
    height: 38px;
    margin-top: 4px;
    margin-right: 10px;
}

/* Bulb icon */
.ihmert-fab-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
    margin-bottom: 7px;
    transition: margin 0.25s ease;
}

.ihmert-fab-icon-wrap svg,
.ihmert-fab-bulb {
    display: block;
    width: 34px;
    height: 34px;
    stroke: #ffffff;
    transition: width 0.3s ease, height 0.3s ease;
}

/* Text inside badge */
.ihmert-fab-text-wrap {
    display: block;
    text-align: center;
}

.ihmert-fab-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 16.5px;
    line-height: 1.15;
    text-align: center;
    display: block;
    letter-spacing: 0.01em;
    transition: all 0.25s ease;
}

.ihmert-fab-line1 {
    display: block;
    line-height: 1.15;
    margin: 0;
    padding: 0;
}

.ihmert-fab-line2 {
    display: block;
    line-height: 1.15;
    margin-top: 1px;
    padding: 0;
}

.ihmert-fab-title-deine {
    display: inline;
}

.ihmert-fab-subtitle {
    display: none;
}

.ihmert-fab-arrow {
    display: none;
}

/* ==========================================================================
   Desktop Scrolled State (Pill Button)
   ========================================================================== */
#ihmert-fab.is-scrolled {
    width: auto !important;
    height: auto !important;
    border-radius: 50px !important;
    border: none !important;
    padding: 14px 24px !important;
    flex-direction: row !important;
    gap: 10px !important;
    right: 24px !important;
    bottom: 24px !important;
    background: #2e7d46 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22) !important;
}

#ihmert-fab.is-scrolled:hover {
    background: #266b3c !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3) !important;
}

#ihmert-fab.is-scrolled .ihmert-fab-badge-plus {
    opacity: 0 !important;
    transform: scale(0) !important;
    pointer-events: none !important;
}

#ihmert-fab.is-scrolled .ihmert-fab-note-wrap {
    opacity: 0 !important;
    transform: translateY(12px) !important;
    pointer-events: none !important;
}

#ihmert-fab.is-scrolled .ihmert-fab-bulb {
    width: 20px !important;
    height: 20px !important;
}

#ihmert-fab.is-scrolled .ihmert-fab-icon-wrap {
    margin-bottom: 0 !important;
}

#ihmert-fab.is-scrolled .ihmert-fab-title {
    font-size: 15px !important;
    white-space: nowrap !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
}

#ihmert-fab.is-scrolled .ihmert-fab-line1 {
    display: inline !important;
    line-height: 1 !important;
}

#ihmert-fab.is-scrolled .ihmert-fab-line2 {
    display: inline !important;
    line-height: 1 !important;
    margin-top: 0 !important;
    margin-left: 4px !important;
}

#ihmert-fab.is-scrolled .ihmert-fab-title-deine {
    display: none !important;
}

/* ==========================================================================
   Mobile Bottom Bar (Untouched, remains full banner)
   ========================================================================== */
@media (max-width: 640px) {
    #ihmert-fab,
    #ihmert-fab.is-scrolled {
        left: 16px !important;
        right: 16px !important;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
        width: auto !important;
        height: auto !important;
        max-width: 480px !important;
        margin: 0 auto !important;
        padding: 13px 18px !important;
        background: linear-gradient(135deg, #348030 0%, #296825 100%) !important;
        border-radius: 26px !important;
        border: none !important;
        box-shadow: 0 10px 28px rgba(32, 85, 26, 0.42) !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        transform: none !important;
    }

    #ihmert-fab:hover,
    #ihmert-fab.is-scrolled:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 14px 34px rgba(32, 85, 26, 0.5) !important;
    }

    .ihmert-fab-badge-plus {
        display: none !important;
    }

    .ihmert-fab-note-wrap {
        display: none !important;
    }

    .ihmert-fab-icon-wrap {
        width: 32px !important;
        height: 32px !important;
        margin-bottom: 0 !important;
    }

    .ihmert-fab-icon-wrap svg,
    .ihmert-fab-bulb,
    #ihmert-fab.is-scrolled .ihmert-fab-bulb {
        width: 30px !important;
        height: 30px !important;
    }

    .ihmert-fab-text-wrap {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    .ihmert-fab-title,
    #ihmert-fab.is-scrolled .ihmert-fab-title {
        font-size: 15.5px !important;
        font-weight: 700 !important;
        color: #ffffff !important;
        line-height: 1.25 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
        display: block !important;
        text-align: left !important;
    }

    .ihmert-fab-line1,
    #ihmert-fab.is-scrolled .ihmert-fab-line1 {
        display: inline !important;
        line-height: 1.25 !important;
    }

    .ihmert-fab-line2,
    #ihmert-fab.is-scrolled .ihmert-fab-line2 {
        display: inline !important;
        line-height: 1.25 !important;
        margin-top: 0 !important;
        margin-left: 4px !important;
    }

    .ihmert-fab-title-deine,
    #ihmert-fab.is-scrolled .ihmert-fab-title-deine {
        display: inline !important;
    }

    .ihmert-fab-subtitle {
        display: block !important;
        font-size: 12px !important;
        font-weight: 400 !important;
        color: rgba(255, 255, 255, 0.9) !important;
        line-height: 1.2 !important;
        margin-top: 2px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }

    .ihmert-fab-arrow {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        color: #ffffff !important;
        width: 22px !important;
        height: 22px !important;
    }

    .ihmert-fab-arrow svg {
        width: 20px !important;
        height: 20px !important;
        stroke: #ffffff !important;
    }
}

/* ==========================================================================
   2. Modal Backdrop & Dialog
   ========================================================================== */
#io-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(20, 20, 20, 0.58);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    font-family: var(--body_typography-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    opacity: 0;
    transition: opacity 0.25s ease;
    box-sizing: border-box;
}

#io-backdrop.io-active {
    opacity: 1;
}

.io-modal {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 620px;
    max-height: 92vh;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
    transform: scale(0.96) translateY(12px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#io-backdrop.io-active .io-modal {
    transform: scale(1) translateY(0);
}

/* Header */
.io-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px 16px;
    border-bottom: none;
    flex-shrink: 0;
}

.io-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #333333;
    font-family: var(--h1_typography-font-family, inherit);
    font-size: 18px;
    line-height: 1.2;
}

.io-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #e8641e;
    font-size: 20px;
}

.io-title-icon svg {
    vertical-align: -0.15em;
}

.io-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #999999;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: color 0.18s ease, background-color 0.18s ease;
}

.io-close:hover {
    color: #333333;
    background-color: #f5f3f0;
}

/* 6-Segment Progress Bar */
.io-progress-bar {
    display: flex;
    gap: 6px;
    padding: 0 28px 18px;
    flex-shrink: 0;
}

.io-seg {
    flex: 1;
    height: 6px;
    border-radius: 4px;
    background: #e6e0d8;
    transition: background-color 0.25s ease;
}

.io-seg.is-active,
.io-seg.is-passed {
    background: #e8641e;
}

/* Modal Body */
.io-body {
    padding: 4px 28px 24px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

/* Step Badge */
.io-step-badge {
    color: #e8641e;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-family: var(--body_typography-font-family, inherit);
    display: block;
}

/* ==========================================================================
   3. Gravity Forms 2 Custom Styling (Matching index.html Look & Feel)
   ========================================================================== */

/* Hide standard GF progress bar and headers as we provide custom header & bar */
#gform_wrapper_2 .gf_progressbar_wrapper,
#gform_wrapper_2 .gform_heading,
#gform_wrapper_2 .gfield_description {
    display: none !important;
}

/* Override Gravity Forms theme variables to match #e8641e brand */
#gform_wrapper_2.gform-theme,
#gform_wrapper_2[data-form-index="0"].gform-theme {
    --gf-color-primary: #e8641e !important;
    --gf-color-primary-rgb: 232, 100, 30 !important;
    --gf-color-primary-contrast: #ffffff !important;
    --gf-color-primary-darker: #cf5416 !important;
    --gf-color-primary-lighter: #f77836 !important;
    --gf-color-secondary: #ffffff !important;
    --gf-color-secondary-contrast: #555555 !important;
    --gf-color-in-ctrl-primary: #e8641e !important;
    --gf-ctrl-border-color: #ddd6cd !important;
    --gf-radius: 8px !important;
    --gf-font-family: var(--body_typography-font-family, inherit) !important;
}

/* Remove default wrapper spacing / borders */
#gform_wrapper_2 {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

#gform_wrapper_2 form {
    margin: 0 !important;
    padding: 0 !important;
}

#gform_wrapper_2 .gform_body {
    width: 100% !important;
}

#gform_wrapper_2 .gform_fields {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

#gform_wrapper_2 .gfield {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

/* Headlines and paragraph texts inside HTML blocks */
#gform_wrapper_2 .form-headline {
    margin: 0 0 8px !important;
    font-family: var(--h1_typography-font-family, inherit) !important;
    font-weight: 700 !important;
    font-size: 26px !important;
    color: #333333 !important;
    line-height: 1.25 !important;
}

#gform_wrapper_2 .form-content {
    margin: 0 0 16px !important;
    color: #666666 !important;
    font-size: 15px !important;
    line-height: 1.55 !important;
    font-family: var(--body_typography-font-family, inherit) !important;
}

#gform_wrapper_2 .form-content-highlight {
    margin: 14px 0 0 !important;
    color: #e8641e !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
}

#gform_wrapper_2 .form-content-special {
    margin: 14px 0 0 !important;
    color: #8a8378 !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    font-family: var(--body_typography-font-family, inherit) !important;
}

/* Labels */
#gform_wrapper_2 .gfield_label {
    display: block !important;
    font-weight: 700 !important;
    color: #333333 !important;
    font-size: 14px !important;
    margin-bottom: 8px !important;
    font-family: var(--body_typography-font-family, inherit) !important;
    line-height: 1.3 !important;
}

/* Inputs and Textareas */
#gform_wrapper_2 input[type="text"],
#gform_wrapper_2 input[type="email"],
#gform_wrapper_2 input[type="tel"],
#gform_wrapper_2 input[type="url"],
#gform_wrapper_2 textarea {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 14px 16px !important;
    border: 1px solid #ddd6cd !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-family: var(--body_typography-font-family, inherit) !important;
    color: #333333 !important;
    background-color: #ffffff !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    outline: none !important;
}

#gform_wrapper_2 input[type="text"]::placeholder,
#gform_wrapper_2 input[type="email"]::placeholder,
#gform_wrapper_2 input[type="tel"]::placeholder,
#gform_wrapper_2 textarea::placeholder {
    color: #a09990 !important;
    opacity: 1 !important;
}

#gform_wrapper_2 input[type="text"]:focus,
#gform_wrapper_2 input[type="email"]:focus,
#gform_wrapper_2 input[type="tel"]:focus,
#gform_wrapper_2 textarea:focus {
    border-color: #e8641e !important;
    box-shadow: 0 0 0 3px rgba(232, 100, 30, 0.16) !important;
}

#gform_wrapper_2 textarea {
    min-height: 130px !important;
    resize: vertical !important;
    line-height: 1.5 !important;
}

/* File Upload Field */
#gform_wrapper_2 .ginput_container_fileupload {
    margin: 8px 0 !important;
}

#gform_wrapper_2 .gform_fileupload_multifile,
#gform_wrapper_2 .ginput_container_fileupload {
    border: 2px dashed #d7d0c6;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    background: #faf8f5;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

#gform_wrapper_2 .gform_fileupload_multifile:hover,
#gform_wrapper_2 .ginput_container_fileupload:hover {
    border-color: #e8641e;
}

#gform_wrapper_2 input[type="file"] {
    display: inline-block !important;
    margin: 0 auto !important;
    font-size: 14px !important;
    color: #555555 !important;
    font-family: var(--body_typography-font-family, inherit) !important;
}

/* Checkboxes and Radios (Modern pill or neat box) */
#gform_wrapper_2 .gfield_checkbox,
#gform_wrapper_2 .gfield_radio {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
}

#gform_wrapper_2 .gchoice {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
}

#gform_wrapper_2 .gchoice input[type="checkbox"],
#gform_wrapper_2 .gchoice input[type="radio"] {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    accent-color: #e8641e !important;
    cursor: pointer !important;
}

#gform_wrapper_2 .gchoice label {
    margin: 0 !important;
    font-size: 14px !important;
    color: #444444 !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    line-height: 1.4 !important;
}

/* Consent (Datenschutz) Checkbox */
#gform_wrapper_2 .gfield_consent {
    border: 1px solid #ece8e2 !important;
    border-radius: 10px !important;
    padding: 16px 18px !important;
    background: #faf8f5 !important;
}

#gform_wrapper_2 .gfield_consent .gchoice {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
}

#gform_wrapper_2 .gfield_consent input[type="checkbox"] {
    margin-top: 3px !important;
}

#gform_wrapper_2 .gfield_consent label {
    font-size: 13px !important;
    color: #555555 !important;
    line-height: 1.5 !important;
}

#gform_wrapper_2 .gfield_consent a {
    color: #e8641e !important;
    text-decoration: underline !important;
}

/* ==========================================================================
   4. Footer Buttons (Zurück / Weiter / Idee einreichen)
   ========================================================================== */
#gform_wrapper_2 .gform_page_footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 18px 0 0 !important;
    margin-top: 20px !important;
    border-top: 1px solid #f0ece6 !important;
    box-sizing: border-box !important;
}

/* Zurück-Button */
#gform_wrapper_2 .gform_previous_button {
    order: 1 !important;
    padding: 12px 24px !important;
    background: #ffffff !important;
    border: 1px solid #ddd6cd !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    color: #555555 !important;
    cursor: pointer !important;
    font-family: var(--body_typography-font-family, inherit) !important;
    transition: all 0.2s ease !important;
    line-height: 1 !important;
}

#gform_wrapper_2 .gform_previous_button:hover {
    background: #f7f5f2 !important;
    border-color: #cbc4bb !important;
    color: #333333 !important;
}

/* Weiter & Submit Button */
#gform_wrapper_2 .gform_next_button,
#gform_wrapper_2 .gform_button {
    order: 2 !important;
    margin-left: auto !important;
    padding: 13px 28px !important;
    background: #e8641e !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 50px !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    cursor: pointer !important;
    font-family: var(--body_typography-font-family, inherit) !important;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease !important;
    box-shadow: 0 4px 14px rgba(232, 100, 30, 0.25) !important;
    line-height: 1 !important;
}

#gform_wrapper_2 .gform_next_button:hover,
#gform_wrapper_2 .gform_button:hover {
    background: #cf5416 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 22px rgba(232, 100, 30, 0.38) !important;
}

#gform_wrapper_2 .gform_next_button:active,
#gform_wrapper_2 .gform_button:active {
    transform: translateY(0) !important;
}

/* Validation Errors */
#gform_wrapper_2 .gfield_error input,
#gform_wrapper_2 .gfield_error textarea {
    border-color: #e04b3a !important;
    background-color: #fff9f8 !important;
}

#gform_wrapper_2 .validation_message {
    color: #e04b3a !important;
    font-size: 13px !important;
    margin-top: 6px !important;
    font-weight: 500 !important;
}

/* ==========================================================================
   5. Confirmation Message (Success Screen)
   ========================================================================== */
#gform_confirmation_wrapper_2,
.gform_confirmation_message_2 {
    text-align: center !important;
    padding: 36px 12px !important;
    animation: ioFadeIn 0.3s ease;
}

.io-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #fdf1ea;
    color: #e8641e;
    margin-bottom: 20px;
    font-size: 34px;
}

.io-success-title {
    margin: 0 0 10px !important;
    font-family: var(--h1_typography-font-family, inherit) !important;
    font-weight: 700 !important;
    font-size: 26px !important;
    color: #333333 !important;
}

.io-success-desc {
    margin: 0 auto !important;
    max-width: 480px;
    color: #666666 !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    font-family: var(--body_typography-font-family, inherit) !important;
}

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

/* Responsive modal sizing */
@media (max-width: 640px) {
    #io-backdrop {
        padding: 12px;
    }
    .io-modal {
        max-height: 95vh;
        border-radius: 14px;
    }
    .io-header {
        padding: 18px 20px 12px;
    }
    .io-title {
        font-size: 16px;
    }
    .io-progress-bar {
        padding: 0 20px 14px;
        gap: 4px;
    }
    .io-body {
        padding: 4px 20px 20px;
    }
    #gform_wrapper_2 .form-headline {
        font-size: 22px !important;
    }
}
