/* ==========================================================================
   Baustellen.net – Frontend (öffentliche Seiten)
   Wird von app/Views/layouts/frontend.php eingebunden.
   ========================================================================== */

:root {
    --primary: #2c3e50;
    --primary-dark: #1a252f;
    --accent: #3498db;
    --accent-hover: #2980b9;
    --accent-soft: #e8f4fd;
    --text: #34495e;
    --text-muted: #7f8c8d;
    --bg: #f8f9fa;
    --surface: #ffffff;
    --border: #eef2f5;
    --input-border: #cbd5e0;
    --error: #e74c3c;
    --success: #2ecc71;
    --roadmap: #e67e22;
    --radius: 8px;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    --header-h: 60px;
    color-scheme: light;
}

/* Grüne Variante für das Pilotprogramm */
.accent-pilot {
    --accent: #27ae60;
    --accent-hover: #219653;
    --accent-soft: #e8f8f0;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1 0 auto; }

img { max-width: 100%; height: auto; }

a { color: var(--accent); }

h1, h2, h3 { color: var(--primary); line-height: 1.25; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

.skip-link {
    position: absolute; left: -9999px; top: 0;
    background: var(--surface); padding: 8px 12px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* --------------------------------------------------------------------------
   Header / Navigation
   -------------------------------------------------------------------------- */
.site-header {
    background: var(--primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-h);
    gap: 16px;
}
.brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.brand-mark { display: block; width: 28px; height: 28px; flex: none; }

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.site-nav a {
    display: block;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.95rem;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, 0.1); }
.site-nav .nav-cta {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    margin-left: 8px;
}
.site-nav .nav-cta:hover { background: var(--accent-hover); }

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 760px) {
    .nav-toggle { display: inline-block; }
    .site-nav {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--primary);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 8px 20px 16px;
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    }
    .site-nav.is-open { display: block; }
    .site-nav ul { flex-direction: column; align-items: stretch; }
    .site-nav a { padding: 12px; }
    .site-nav .nav-cta { margin: 8px 0 0; text-align: center; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    padding: 24px 0;
    margin-top: 0;
}
.site-footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

/* --------------------------------------------------------------------------
   Buttons, Badges
   -------------------------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
}
.btn:hover { background: var(--accent-hover); }
.btn-block { display: block; width: 100%; }

.badge-pilot {
    display: inline-block; background: var(--accent); color: #fff;
    font-size: 0.85rem; text-transform: uppercase; font-weight: bold;
    padding: 4px 10px; border-radius: 4px; margin-bottom: 15px;
}

/* --------------------------------------------------------------------------
   Inhaltsseiten (Impressum, Datenschutz, Lizenzen, Formulare)
   -------------------------------------------------------------------------- */
.page { padding: 40px 20px; }

.content-card {
    max-width: 700px;
    margin: 0 auto;
    background: var(--surface);
    padding: 2.5rem 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.content-card--narrow { max-width: 520px; }
.content-card--center { text-align: center; }

.prose h1 {
    font-size: 2rem;
    margin: 0 0 1.5rem;
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 0.5rem;
}
.prose h2 { font-size: 1.3rem; margin: 1.8rem 0 0.8rem; }
.prose h3 { font-size: 1.1rem; margin: 1rem 0 0.4rem; color: #444; }
.prose p { margin: 0 0 1rem; }
.prose ul.plain { list-style: none; padding-left: 0; }
.prose ul.plain li { margin-bottom: 0.3rem; }
.prose a { text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.footer-note { margin-top: 2rem; font-size: 0.9rem; color: #777; }

@media (max-width: 600px) {
    .page { padding: 20px 12px; }
    .content-card { padding: 1.5rem 1.25rem; }
    .prose h1 { font-size: 1.6rem; }
}

/* --------------------------------------------------------------------------
   Formulare
   -------------------------------------------------------------------------- */
.form h1 { font-size: 1.8rem; margin: 0 0 8px; text-align: center; }
.form .subtitle { text-align: center; color: var(--text-muted); margin: 0 0 25px; font-size: 0.95rem; }
.form label { display: block; margin-bottom: 6px; font-weight: bold; color: var(--primary); font-size: 0.9rem; }
.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="tel"] {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 18px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color .2s, box-shadow .2s;
}
.form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form button[type="submit"] { margin-top: 10px; }

@media (max-width: 480px) {
    .form .form-row { grid-template-columns: 1fr; gap: 0; }
}

.info-box {
    background: var(--accent-soft);
    border-left: 4px solid var(--accent);
    padding: 12px 15px;
    margin-bottom: 25px;
    font-size: 0.9rem;
    border-radius: 0 4px 4px 0;
    color: var(--primary);
}

.error-list {
    background: #fdf2f2;
    border: 1px solid #f8d7da;
    color: var(--error);
    list-style: none;
    padding: 15px;
    margin: 0 0 20px;
    border-radius: 4px;
    font-size: 0.9rem;
}
.error-list li { margin-bottom: 5px; }
.error-list li:last-child { margin-bottom: 0; }
.error-list li::before { content: "⚠️ "; }

.success-box {
    background: #f2fdf5;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.text-center { text-align: center; }

/* --------------------------------------------------------------------------
   Marketing-Seiten (Für Gemeinden, Pilotprogramm)
   -------------------------------------------------------------------------- */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 80px 0;
    text-align: center;
}
.hero h1 { color: #fff; font-size: 2.5rem; margin: 0 0 20px; font-weight: 700; }
.hero p { font-size: 1.25rem; max-width: 800px; margin: 0 auto 30px; opacity: 0.9; }

.section { padding: 60px 0; }
.section--white { background: var(--surface); }
.section--light { background: var(--bg); }
.section--center { text-align: center; }
.section-title { text-align: center; font-size: 2rem; margin: 0 0 40px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 30px; }
.feature-card { padding: 30px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border); }
.feature-card h3 { margin-top: 0; font-size: 1.3rem; }

.sub-feature-box { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; margin-top: 30px; }
.sub-feature-box h3 { margin-top: 0; font-size: 1.4rem; }
.notification-channels {
    list-style: none; padding: 0; margin: 20px 0 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 15px;
}
.notification-channels li {
    background: var(--surface); padding: 15px; border-radius: 6px;
    border-left: 3px solid var(--accent); font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.notice-bar {
    background: var(--accent-soft);
    border-left: 4px solid var(--accent);
    padding: 20px;
    margin-top: 30px;
    border-radius: 0 4px 4px 0;
    text-align: left;
}

.price-card {
    max-width: 550px; margin: 0 auto; padding: 40px 30px;
    border: 2px solid var(--accent); border-radius: var(--radius); background: var(--bg);
}
.price { font-size: 3rem; font-weight: bold; color: var(--primary); margin: 20px 0; }
.price span { font-size: 1.2rem; font-weight: normal; color: var(--text-muted); }
.price--accent { color: var(--accent); margin: 15px 0; }
.price-note { font-size: 0.9rem; color: var(--text-muted); margin-top: -15px; }
.price-note--accent { color: var(--accent); font-weight: bold; margin-top: -10px; }
.price-features { list-style: none; padding: 0; margin: 30px 0; text-align: left; }
.price-features li { margin-bottom: 12px; padding-left: 25px; position: relative; }
.price-features li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: bold; }
.accent-pilot .price-features li::before { color: var(--accent); }

@media (max-width: 600px) {
    .hero { padding: 48px 0; }
    .hero h1 { font-size: 1.75rem; }
    .hero p { font-size: 1.05rem; }
    .section { padding: 40px 0; }
    .section-title { font-size: 1.5rem; margin-bottom: 28px; }
    .feature-card, .sub-feature-box { padding: 20px; }
    .price-card { padding: 28px 18px; }
    .price { font-size: 2.4rem; }
    .btn { padding: 12px 20px; font-size: 1rem; }
}

/* --------------------------------------------------------------------------
   Startseite & gemeinsame Marketing-Bausteine
   -------------------------------------------------------------------------- */
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.6);
    padding: 10px 28px;
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.1); border-color: #fff; }
.btn-outline--dark { color: var(--accent); border-color: var(--accent); }
.btn-outline--dark:hover { background: var(--accent-soft); border-color: var(--accent); }

.lead { font-size: 1.15rem; max-width: 760px; margin: 0 auto 1rem; }
.section-intro { max-width: 760px; margin: -20px auto 40px; text-align: center; font-size: 1.05rem; }

.steps {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 30px;
    counter-reset: step;
}
.steps li {
    counter-increment: step;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 28px 24px 24px; position: relative;
}
.steps li::before {
    content: counter(step);
    display: inline-grid; place-items: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent); color: #fff; font-weight: bold;
    margin-bottom: 12px;
}
.steps h3 { margin: 0 0 8px; font-size: 1.15rem; }
.steps p { margin: 0; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.split h2 { margin-top: 0; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; gap: 24px; } }

.check-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.check-list li { padding-left: 26px; position: relative; margin-bottom: 10px; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: bold; }
.accent-pilot .check-list li::before { color: var(--accent); }

.tag-planned {
    display: inline-block; font-size: 0.72rem; font-weight: bold; text-transform: uppercase;
    letter-spacing: 0.03em; padding: 2px 7px; border-radius: 3px;
    background: #fdebd9; color: #a04e0b; vertical-align: middle; margin-left: 6px;
}

.code-sample {
    background: #1e2a36; color: #d7e1ea; border-radius: var(--radius);
    padding: 18px 20px; overflow-x: auto; font-size: 0.82rem; line-height: 1.55;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    margin: 0; text-align: left;
}
.code-sample .c { color: #8fa0b0; }
.code-sample .t { color: #7fc4f0; }
.code-caption { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; }

.faq { max-width: 800px; margin: 0 auto; }
.faq details {
    background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
    margin-bottom: 10px; padding: 0 18px;
}
.faq summary {
    cursor: pointer; font-weight: 600; color: var(--primary);
    padding: 14px 0; list-style-position: inside;
}
.faq details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.faq details p { margin: 0 0 14px; }

.contact-card {
    display: flex; gap: 20px; align-items: flex-start;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px; max-width: 760px; margin: 0 auto;
}
.contact-card__avatar {
    flex: none; width: 56px; height: 56px; border-radius: 50%;
    display: grid; place-items: center; background: var(--primary); color: #fff;
    font-weight: bold; font-size: 1.1rem;
}
.contact-card h3 { margin: 0 0 6px; }
.contact-card p { margin: 0 0 8px; }
@media (max-width: 500px) { .contact-card { flex-direction: column; } }

.cta-band { background: var(--primary); color: #fff; text-align: center; padding: 50px 0; }
.cta-band h2 { color: #fff; margin: 0 0 12px; }
.cta-band p { margin: 0 auto 24px; max-width: 640px; opacity: 0.9; }

.source-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.source-list li { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 14px; font-size: 0.9rem; }

.mt-0 { margin-top: 0; }
.mt-lg { margin-top: 30px; }
.mt-sm { margin-top: 12px; }
.form .form-note { font-size: 0.85rem; color: var(--text-muted); margin: 4px 0 0; }

/* FAQ-Seite: Themenübersicht */
.faq-index { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 8px; }
.faq + .section-title { margin-top: 40px; }
