/*
 * Main stylesheet for Immobilien Optimieren.
 * Extracted from the former inline styles in layouts/head.html to enable
 * centralized styling and optimal HTTP caching via Spring's resource pipeline.
 */
:root {
    /* Pastell-Basis */
    --brand: #7466df;          /* gedecktes Violett */
    --accent: #7fd3e5;         /* (weiterhin für Hintergründe, dezent) */
    --ink: #0f172a;            /* Text */
    --muted: #475569;          /* Sekundärtext */
    --surface: #ffffff;        /* Kartenfläche */
    --bg: #f6f7fb;             /* Seitenhintergrund */
    --radius: 18px;
    --shadow-1: 0 10px 24px rgba(2, 6, 23, .06);
    --shadow-2: 0 24px 60px rgba(2, 6, 23, .12);
    --bs-heading-font-family: "Playfair Display", Georgia, serif;

    /* CTA-Gradient auf Logo-Farben (Indigo → Blau) */
    --cta1: #2d3180;
    --cta2: #4f6dd0;
    /* Dezenter Text-Gradient (professioneller, weniger spielerisch) */
    --soft1: #30377f; /* indigo */
    --soft2: #6e7fd9; /* gedämpftes Blau */
    /* Abstand für Anker-Sprünge (fixierte Navigation ausgleichen) */
    --scroll-offset: clamp(88px, 12vh, 144px);
}

html,
body {
    height: 100%;
}

html {
    scroll-padding-top: var(--scroll-offset);
}

[data-scroll-section] {
    scroll-margin-top: var(--scroll-offset);
}

body {
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--ink);
    background-color: var(--bg);
    background-image:
        radial-gradient(70% 60% at 85% 0%, rgba(116, 102, 223, .1), transparent 65%),
        radial-gradient(80% 70% at 10% 100%, rgba(127, 211, 229, .12), transparent 70%),
        linear-gradient(180deg, #fafbff 0%, #f6f8ff 55%, #f8fafc 100%);
    background-repeat: no-repeat;
    scroll-behavior: smooth;
}

h1,
h2,
h3,
.display-1,
.display-2,
.display-3 {
    font-family: "Playfair Display", Georgia, serif;
    letter-spacing: .2px;
}

/* Lange Wörter sauber umbrechen */
h1,
h2,
h3,
.display-1,
.display-2,
.display-3,
.lead,
.nav-link,
.btn {
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
}

.btn[data-loading-state="loading"] [data-loading-label] {
    display: none !important;
}

.btn[data-loading-state="loading"] [data-loading-indicator] {
    display: inline-flex !important;
}

/* NAVBAR */
.navbar-glass {
    backdrop-filter: saturate(160%) blur(10px);
    background: rgba(255, 255, 255, .82);
    border-bottom: 1px solid rgba(2, 6, 23, .06);
    transition: .35s;
}

.navbar-glass.navbar-solid {
    background: #fff;
    box-shadow: var(--shadow-1);
    border-color: rgba(2, 6, 23, .12);
}

.navbar .container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.navbar .navbar-brand {
    font-weight: 700;
    letter-spacing: .2px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
}

.navbar .navbar-brand img {
    height: 28px;
    width: auto;
}

.navbar .navbar-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 65vw;
}

.navbar-toggler {
    margin-left: auto;
}

.navbar .cta-wrap {
    gap: .5rem;
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        flex-basis: 100%;
        width: 100%;
        text-align: center;
    }

    .navbar-nav {
        margin-top: .75rem;
        flex-direction: column !important;
        gap: .25rem;
    }

    .navbar .cta-wrap {
        display: flex;
        justify-content: center;
        margin-top: .75rem;
    }
}

/* PROGRESS */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    z-index: 1080;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    box-shadow: 0 0 8px rgba(116, 102, 223, .35);
}

/* HERO */
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(6rem, 7vw, 9rem) 0 5rem;
}

.hero-blob {
    position: absolute;
    inset: 0;
    z-index: -1;
    filter: blur(48px) saturate(110%);
    opacity: .35;
}

.blob {
    position: absolute;
    border-radius: 999px;
}

.blob.b1 {
    width: 540px;
    height: 540px;
    background: #7466df;
    left: -120px;
    top: -120px;
    animation: float1 18s ease-in-out infinite;
    opacity: .18;
}

.blob.b2 {
    width: 580px;
    height: 580px;
    background: #7fd3e5;
    right: -160px;
    top: -160px;
    animation: float2 22s ease-in-out infinite;
    opacity: .18;
}

.blob.b3 {
    width: 400px;
    height: 400px;
    background: #0f172a;
    left: 40%;
    bottom: -160px;
    opacity: .06;
    animation: float3 26s ease-in-out infinite;
}

@keyframes float1 {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(24px) scale(1.02);
    }
}

@keyframes float2 {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-20px) scale(1.03);
    }
}

@keyframes float3 {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(28px) scale(.99);
    }
}

/* CARDS */
.card {
    border: 1px solid rgba(2, 6, 23, .08);
    background: var(--surface);
    box-shadow: var(--shadow-1);
    border-radius: var(--radius);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2);
    border-color: rgba(2, 6, 23, .14);
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    border-radius: .9rem;
    background: radial-gradient(120% 120% at 10% 10%, rgba(116, 102, 223, .16), rgba(127, 211, 229, .12));
    color: #1f2937;
}

.reveal {
    opacity: 0;
    transform: translateY(16px) scale(.98);
    transition: opacity .6s ease, transform .6s ease;
}

.reveal.show {
    opacity: 1;
    transform: none;
}

/* CTA-Button (Logo-Gradient) */
.btn-gradient {
    background: linear-gradient(90deg, var(--cta1), var(--cta2));
    border: 0;
    color: #fff;
}

.btn-gradient:hover,
.btn-gradient:focus,
.btn-gradient:active {
    color: #fff;
}

.btn-gradient-animated {
    transform: translateY(0) scale(1);
    transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
    will-change: transform;
}

.btn-gradient-animated:not(:disabled):not(.disabled):hover,
.btn-gradient-animated:not(:disabled):not(.disabled):focus-visible {
    filter: brightness(1.08);
    transform: translateY(-1px) scale(1.035);
    box-shadow: var(--shadow-2);
}

@media (prefers-reduced-motion: reduce) {
    .btn-gradient-animated {
        transition: filter .22s ease;
    }

    .btn-gradient-animated:not(:disabled):not(.disabled):hover,
    .btn-gradient-animated:not(:disabled):not(.disabled):focus-visible {
        transform: none;
    }
}

.navbar .btn-gradient {
    color: #fff !important;
    transition: none;
    transform: none !important;
    box-shadow: none !important;
}

.navbar .btn-gradient:hover,
.navbar .btn-gradient:focus,
.navbar .btn-gradient:focus-visible,
.navbar .btn-gradient:active {
    color: #fff !important;
    filter: none !important;
    transform: none !important;
    box-shadow: none !important;
}

/* HERO CTAs – Paar bündelt 'Anrufen' + 'E-Mail' */
.cta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.cta-pair {
    display: flex;
    gap: 1rem;
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    .cta-row {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 575.98px) {
    .cta-pair {
        flex-basis: 100%;
        justify-content: center;
    }
}

.gallery img {
    border-radius: calc(var(--radius) - .25rem);
    box-shadow: var(--shadow-1);
}

#toTop {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1080;
    opacity: 0;
    transform: translateY(10px);
    transition: .3s ease;
}

#toTop.show {
    opacity: 1;
    transform: none;
}

.form-control,
.form-select {
    background: #fff;
    border-color: rgba(2, 6, 23, .12);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 .2rem rgba(127, 211, 229, .25);
}

.badge-soft {
    background: rgba(15, 23, 42, .06);
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, .08);
}

/* Section background safety */
section {
    background: transparent;
    position: relative;
    z-index: 0;
}

.section-gradient {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.section-gradient::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(80% 80% at 85% 10%, rgba(116, 102, 223, .1), transparent 70%),
        radial-gradient(85% 75% at 15% 90%, rgba(127, 211, 229, .12), transparent 70%),
        linear-gradient(180deg, rgba(250, 251, 255, .96), rgba(245, 247, 253, .96));
}

.section-gradient.section-gradient-alt::before {
    background:
        radial-gradient(80% 80% at 20% 15%, rgba(127, 211, 229, .12), transparent 70%),
        radial-gradient(85% 75% at 80% 90%, rgba(116, 102, 223, .1), transparent 70%),
        linear-gradient(180deg, rgba(249, 250, 255, .96), rgba(244, 246, 252, .96));
}

.section-plain {
    background: #fff;
}

/* Gradients */
.gradient-text {
    background: linear-gradient(90deg, var(--brand), var(--ink));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.gradient-text-soft {
    background: linear-gradient(90deg, var(--soft1), var(--soft2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Text */
.text-muted {
    color: var(--muted) !important;
}

.text-soft {
    color: var(--soft1) !important;
}

/* Practice example */
.cost-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin: 0;
    padding: 0;
}

.cost-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid rgba(15, 23, 42, .08);
}

.cost-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.cost-label {
    font-weight: 500;
    color: var(--ink);
}

.cost-value {
    font-weight: 600;
    white-space: nowrap;
    text-align: right;
}

.cost-row-savings .cost-value {
    color: var(--soft1);
}

.chart-card {
    height: 100%;
}

.simple-chart {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.simple-chart-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
}

.simple-chart-label {
    font-weight: 500;
    color: var(--ink);
}

.simple-chart-measure {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.simple-chart-barwrap {
    position: relative;
    flex: 1;
    height: .65rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, .08);
    overflow: hidden;
}

.simple-chart-bar {
    position: absolute;
    inset: 0;
    width: var(--bar-size, 0%);
    background: linear-gradient(90deg, rgba(127, 211, 229, .95), rgba(127, 211, 229, .45));
    border-radius: inherit;
}

.simple-chart-row.negative .simple-chart-bar {
    background: linear-gradient(90deg, rgba(116, 102, 223, .9), rgba(116, 102, 223, .45));
}

.simple-chart-row.total .simple-chart-bar {
    background: linear-gradient(90deg, rgba(14, 165, 233, .95), rgba(14, 165, 233, .5));
}

.simple-chart-row.net .simple-chart-bar {
    background: linear-gradient(90deg, rgba(16, 185, 129, .9), rgba(16, 185, 129, .45));
}

.simple-chart-value {
    font-weight: 600;
    white-space: nowrap;
    color: var(--ink);
}

.simple-chart-row.negative .simple-chart-value {
    color: var(--soft1);
}

.simple-chart-row.total .simple-chart-label {
    font-weight: 600;
}

.simple-chart-note {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.simple-chart-pill {
    display: inline-flex;
    align-items: center;
    padding: .35rem .75rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, .14);
    color: #047857;
    font-weight: 600;
    width: fit-content;
}

.simple-chart-pill.pill-red {
    background: rgba(185, 16, 36, 0.14);
    color: #780427;
}

/* FAQ accordion */
.accordion-button:focus {
    outline: none;
    box-shadow: none;
    border-color: rgba(2, 6, 23, .12);
}

/* Inline-style replacements */
.hero-subtitle {
    max-width: 60ch;
}

.steps-list {
    line-height: 1.9;
}

.footer-logo {
    height: 22px;
    width: auto;
}

.tracking-pixel {
    display: none;
}

.bar-size-100 {
    --bar-size: 100%;
}

.bar-size-17-07 {
    --bar-size: 17.07%;
}

.bar-size-82-93 {
    --bar-size: 82.93%;
}

.bar-size-50-20 {
    --bar-size: 50.2%;
}

.bar-size-49-89 {
    --bar-size: 49.89%;
}

.bar-size-50-11 {
    --bar-size: 50.11%;
}

.bar-size-18-84 {
    --bar-size: 18.84%;
}

.bar-size-81-16 {
    --bar-size: 81.16%;
}
