body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(120deg, #f8fbff, #eef9f3, #f8f9fa);
    background-size: 200% 200%;
    animation: gradientFlow 14s ease infinite;
    position: relative;
    overflow-x: hidden;
}

.wizard-steps {
    display: flex;
    gap: 8px;
}

/* Hide entire monthly grid when "average per month" is selected (avoid any display:flex conflicts) */
.monthly-bills-panel.is-hidden {
    display: none !important;
}

.policy-preline {
    white-space: pre-line;
}

.brand-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* Mobile: title under logo so long Thai text does not crowd the logo */
@media (max-width: 767.98px) {
    .navbar > .container {
        flex-wrap: wrap;
        align-items: flex-start;
        row-gap: 0.5rem;
    }

    .navbar .navbar-brand.brand-wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
        max-width: 100%;
        margin-right: 0;
        line-height: 1.3;
    }

    .navbar .navbar-brand.brand-wrap span[data-i18n='brand'] {
        display: block;
        font-size: 0.92rem;
        padding-right: 0.5rem;
    }

    .navbar > .container > .d-flex.align-items-center {
        margin-left: auto;
    }
}

.brand-logo {
    height: 30px;
    width: auto;
    background: #ffffff;
    border-radius: 6px;
    padding: 2px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.card.shadow-sm {
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 14px 40px rgba(16, 24, 40, 0.08) !important;
}

.result-box {
    border: 1px solid #dfe5e8;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
    min-height: 84px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.btn-primary,
.btn-success {
    position: relative;
    overflow: hidden;
}

.btn-primary::after,
.btn-success::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 90%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-20deg);
}

.btn-primary:hover::after,
.btn-success:hover::after {
    animation: shine 0.8s ease;
}

#nextBtn {
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.35);
}

/* Mobile: center both nav buttons as a group (avoids LINE FAB overlap and prev/next stacking) */
@media (max-width: 767.98px) {
    .wizard-form-nav {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.75rem;
        padding-inline: 0.75rem;
        padding-bottom: calc(1.5rem + 3rem + env(safe-area-inset-bottom, 0px));
    }

    /* Step 1: JS sets visibility:hidden on prev — remove from layout so only Next is centered */
    .wizard-form-nav #prevBtn[style*='visibility: hidden'] {
        display: none !important;
    }
}

.flash-orb {
    position: fixed;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.25;
    pointer-events: none;
    z-index: -1;
}

.flash-orb.orb-1 {
    background: #00d4ff;
    top: 10%;
    left: -80px;
}

.flash-orb.orb-2 {
    background: #00ff95;
    bottom: 10%;
    right: -80px;
}

.modal {
    z-index: 2300 !important;
}

.modal-backdrop {
    z-index: 2290 !important;
}

.modal-backdrop.show {
    opacity: 0.55;
}

.step-enter {
    animation: fadeSlideIn 0.3s ease;
}

.animated-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: #12633f;
}

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

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes shine {
    from {
        left: -120%;
    }
    to {
        left: 130%;
    }
}

/* Step 4 result charts */
.chart-card .chart-card__head {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.02em;
    background: linear-gradient(115deg, #146c43 0%, #1aa062 42%, #0d5131 100%);
}

.chart-card.chart-card--line .chart-card__head {
    background: linear-gradient(115deg, #3a4f9e 0%, #5a6fd8 45%, #2e3d78 100%);
}

.chart-card .chart-wrap {
    position: relative;
    height: 268px;
}

.chart-card .chart-wrap--tall {
    height: 300px;
}

.daytime-slider-block .daytime-range {
    max-width: 100%;
    min-width: 120px;
    accent-color: #157347;
    height: 8px;
}

.daytime-slider-block .daytime-pct-badge {
    min-width: 3.25rem;
    font-size: 1.1rem;
    color: #157347;
}

.line-contact-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 2200;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: #06c755;
    color: #fff;
    border-radius: 999px;
    padding: 8px 12px 8px 8px;
    box-shadow: 0 10px 22px rgba(6, 199, 85, 0.38);
    animation: lineFabPulse 1.8s ease-in-out infinite;
}

.line-contact-fab:hover {
    color: #fff;
    transform: translateY(-1px);
}

.line-contact-fab__icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    color: #06c755;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.line-contact-fab__label {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
}

@media (max-width: 576px) {
    .line-contact-fab {
        right: 12px;
        bottom: 12px;
        padding-right: 10px;
    }

    .line-contact-fab__label {
        font-size: 0.88rem;
    }
}

.survey-engineer-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.survey-engineer-card {
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.survey-engineer-card:hover {
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
}

#surveyCalendar {
    min-height: 520px;
}

#surveyCalendar .fc-event {
    cursor: pointer;
}

.booking-modal-dialog {
    max-height: calc(100vh - 2rem);
    margin: 1rem auto;
}

#bookingModal .modal-content {
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
}

#bookingModal .modal-body {
    overflow-y: auto;
    flex: 1 1 auto;
}

#bookingModal .modal-footer {
    flex-shrink: 0;
    background: #fff;
    border-top: 1px solid #dee2e6;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
}

@keyframes lineFabPulse {
    0%,
    100% {
        box-shadow: 0 10px 22px rgba(6, 199, 85, 0.35);
    }
    50% {
        box-shadow: 0 10px 26px rgba(6, 199, 85, 0.6);
    }
}
