/* LAPP - IT — Website Styles */

:root {
    /* Markenfarben, entnommen aus Logo.png */
    --navy: #2b3d8f;
    --steel: #1b639d;
    --mid: #2696c6;
    --cyan: #29aae1;

    --ink: #2d2d2d;
    --ink-soft: #666;
    --line: #e0e0e0;
    --surface: #f5f5f5;
    --white: #fff;

    --maxw: 1200px;
    --pad: 30px;
    --radius: 4px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Muss nach dem Reset stehen: sonst gewinnt z. B. .form-group { display: flex }
   gegen das hidden-Attribut und das Feld bliebe sichtbar. */
[hidden] { display: none !important; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
    color: var(--ink);
    line-height: 1.6;
    background-color: var(--white);
    overflow-x: hidden;
}

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

a, button, input, textarea, select {
    -webkit-tap-highlight-color: rgba(0, 0, 0, .1);
    touch-action: manipulation;
}

:focus-visible {
    outline: 2px solid var(--steel);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: var(--navy);
    color: #fff;
    padding: 10px 16px;
    text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.header {
    background-color: var(--white);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 12px var(--pad);
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo meta nav";
    align-items: center;
    column-gap: 30px;
}

.header-container > * { min-width: 0; }

.header-logo { grid-area: logo; display: block; }

/* 780x140 nativ — bei 34px Höhe rund 4x Pixeldichte, also auch auf Retina scharf */
.header-logo img { height: 34px; width: auto; }

.header-meta {
    grid-area: meta;
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.4;
}

/* Beide Links bekommen Innenabstand als Tippfläche; der negative Aussenabstand
   hält die Kopfzeile dabei gleich hoch. */
.hotline {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 0;
    margin: -4px 0;
}
.hotline:hover { color: var(--navy); }

.teamviewer-link {
    font-size: 12px;
    color: var(--ink-soft);
    text-decoration: underline;
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 0;
    margin: -4px 0;
}
.teamviewer-link:hover { color: var(--ink); }

.header-nav { grid-area: nav; }

.nav-toggle {
    grid-area: nav;
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    padding: 12px 10px;
    flex-direction: column;
    justify-content: space-between;
}
.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 28px;
}

.nav-menu a {
    color: var(--ink);
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 2px;
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
}
.nav-menu a:hover { color: var(--navy); border-bottom-color: var(--cyan); }

/* ---------- Hero ---------- */
.hero-text {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 48px var(--pad) 32px;
}

.hero-text h1 {
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -.5px;
}

.hero-claim {
    font-size: clamp(14px, 2vw, 17px);
    color: var(--ink-soft);
}

/* ---------- Hero-Banner ---------- */
.banner {
    background: radial-gradient(ellipse at center, #b8cfee 0%, #7099d2 55%, #3d68ad 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--pad);
}

.banner-logo {
    width: 100%;
    max-width: 520px;
    height: auto;
}

.banner--hero { height: 400px; }

/* ---------- Trenner zwischen den Abschnitten ----------
   Ersetzt die früheren Farbbänder: eine schmale Linie in den Markenfarben,
   die die durchgehend weissen Abschnitte voneinander abhebt. */
.divider {
    height: 6px;
    background: linear-gradient(90deg,
        var(--navy) 0%,
        var(--steel) 28%,
        var(--cyan) 50%,
        var(--steel) 72%,
        var(--navy) 100%);
}

/* ---------- Dienstleistungen ---------- */
.dienstleistungen {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 64px var(--pad);
}

.dienstleistungen h2,
.form-section h2 {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
    margin-bottom: 10px;
}

.dienstleistungen h2 { margin-bottom: 44px; }

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 36px 56px;
}

.service-box {
    border-bottom: 2px solid var(--line);
    padding-bottom: 28px;
}

.service-box h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.service-subtitle {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
}

.service-text {
    font-size: 14px;
    line-height: 1.75;
    color: var(--ink-soft);
}

/* ---------- Formulare ---------- */
.form-section { padding: 64px var(--pad); }

.form-section > h2,
.form-section > .section-subtitle,
.form-section > .site-form {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
/* Alle Abschnitte weiss — getrennt wird über .divider, nicht über Flächen. */
.support-section,
.kontakt-section { background-color: var(--white); }

.section-subtitle {
    font-size: 16px;
    color: var(--ink-soft);
    margin-bottom: 36px;
}

.site-form {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    padding: 36px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group { display: flex; flex-direction: column; }
.form-group.full-width { margin-bottom: 20px; }

.form-group label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #333;
}

.req { color: #c0392b; }

.form-group input,
.form-group select,
.form-group textarea {
    padding: 11px 12px;
    border: 1px solid #ccc;
    border-radius: 2px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    background-color: var(--white);
    transition: border-color .2s, box-shadow .2s;
}

.form-group textarea { resize: vertical; min-height: 120px; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--steel);
    box-shadow: 0 0 0 3px rgba(27, 99, 157, .15);
}

.form-group input[aria-invalid="true"],
.form-group select[aria-invalid="true"],
.form-group textarea[aria-invalid="true"] {
    border-color: #c0392b;
    background-color: #fdf4f3;
}

.field-error {
    font-size: 12.5px;
    color: #c0392b;
    margin-top: 5px;
}

.checkbox-group { margin-bottom: 20px; }

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--ink-soft);
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--navy);
}

.checkbox-label a { color: var(--steel); }

/* Honeypot — nur für Bots sichtbar */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.captcha-slot:not(:empty) { margin-bottom: 20px; }

.submit-btn {
    /* Rechtsbündig am Ende des Formulars — display:block plus margin-left:auto
       schiebt die Schaltfläche an den rechten Rand. */
    display: block;
    margin-left: auto;
    padding: 13px 40px;
    background-color: var(--navy);
    color: var(--white);
    border: none;
    border-radius: 2px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color .2s, opacity .2s;
}
.submit-btn:hover:not(:disabled) { background-color: #22317a; }
.submit-btn:disabled { opacity: .6; cursor: progress; }

.form-status {
    margin-top: 18px;
    padding: 0;
    font-size: 15px;
    line-height: 1.5;
}
.form-status:not(:empty) {
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid transparent;
}
.form-status.is-success {
    background-color: #e8f6ec;
    color: #1c6b34;
    border-color: #bfe2c9;
}
.form-status.is-error {
    background-color: #fdecea;
    color: #a32b1f;
    border-color: #f5c6c0;
}

/* ---------- Footer ---------- */
.footer {
    background-color: var(--white);
    border-top: 1px solid var(--line);
    padding: 44px var(--pad) 28px;
}

.footer-container {
    max-width: var(--maxw);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
}

.footer-left { display: flex; flex-direction: column; gap: 18px; }
.footer-logo { width: 180px; height: auto; }

.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a {
    color: var(--ink);
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
}
.footer-links a:hover { text-decoration: underline; }

.footer-right { text-align: right; }
.footer-right h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.footer-right address {
    font-style: normal;
    font-size: 13px;
    line-height: 1.75;
    color: var(--ink-soft);
}
.footer-right a {
    color: var(--ink-soft);
    display: inline-block;
    padding: 3px 0;
}

.footer-copy {
    max-width: var(--maxw);
    margin: 28px auto 0;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--ink-soft);
}

/* ---------- Responsive ---------- */
@media (max-width: 968px) {
    .header-container {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "logo toggle"
            "meta meta"
            "nav  nav";
        row-gap: 10px;
        column-gap: 16px;
    }

    .nav-toggle { grid-area: toggle; display: flex; }
    .header-nav { grid-area: nav; }

    .nav-menu {
        display: none;
        flex-direction: column;
        gap: 0;
        border-top: 1px solid var(--line);
        padding-top: 4px;
    }
    .header-nav.is-open .nav-menu { display: flex; }
    .nav-menu a { border-bottom: 1px solid var(--line); }
    .nav-menu li:last-child a { border-bottom: none; }

    .footer-container { flex-direction: column; gap: 28px; }
    .footer-right { text-align: left; }
}

@media (max-width: 768px) {
    :root { --pad: 16px; }

    html { scroll-padding-top: 70px; }

    .header-logo img { height: 30px; }
    .hotline { font-size: 12.5px; min-height: 34px; }
    .teamviewer-link { font-size: 11.5px; min-height: 30px; }
    .footer-links a { min-height: 40px; }

    .hero-text { padding: 30px var(--pad) 22px; }

    .banner--hero { height: 240px; }
    .banner--hero .banner-logo { max-width: min(80vw, 380px); }
    .divider { height: 5px; }

    .dienstleistungen { padding: 40px var(--pad); }
    .dienstleistungen h2 { margin-bottom: 28px; }
    .services-grid { grid-template-columns: 1fr; gap: 26px; }

    .form-section { padding: 40px var(--pad); }
    .section-subtitle { font-size: 15px; margin-bottom: 26px; }

    .site-form { padding: 22px 18px; }
    .form-row { grid-template-columns: 1fr; gap: 16px; }

    /* 16px verhindert das automatische Zoomen in iOS Safari */
    .form-group input,
    .form-group select,
    .form-group textarea { font-size: 16px; padding: 12px; }

    .submit-btn { width: 100%; padding: 15px; }

    .footer { padding: 32px var(--pad) 22px; }
    .footer-logo { width: 150px; }
}

@media (max-width: 380px) {
    .header-logo img { height: 26px; }
    .header-container { column-gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition-duration: .01ms !important; }
}

/* ---------- Overlay für Rechtstexte (Inhalt kommt aus dem Backend) ---------- */
.legal-dialog {
    width: min(760px, calc(100vw - 32px));
    max-height: min(82vh, 900px);
    /* Der Reset oben setzt margin:0 — das native Zentrieren des Dialogs
       muss hier wieder hergestellt werden. */
    margin: auto;
    padding: 0;
    border: none;
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
    color: var(--ink);
    background: var(--white);
    overflow: hidden;
}

.legal-dialog::backdrop {
    background: rgba(20, 28, 50, .55);
    backdrop-filter: blur(2px);
}

.legal-dialog[open] {
    display: flex;
    flex-direction: column;
}

.legal-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    background: var(--white);
}

.legal-head h2 {
    font-size: 19px;
    font-weight: 700;
    flex: 1;
    min-width: 0;
}

.legal-close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--ink-soft);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.legal-close:hover { background: var(--surface); color: var(--ink); }

.legal-body {
    padding: 22px;
    overflow-y: auto;
    flex: 1;
    font-size: 15px;
    line-height: 1.7;
    -webkit-overflow-scrolling: touch;
}

.legal-body h2 { font-size: 18px; margin: 26px 0 10px; font-weight: 700; }
.legal-body h3 { font-size: 16px; margin: 22px 0 8px; font-weight: 700; }
.legal-body h4 { font-size: 15px; margin: 18px 0 6px; font-weight: 600; }
.legal-body > :first-child { margin-top: 0; }
.legal-body p { margin-bottom: 14px; }
.legal-body ul,
.legal-body ol { margin: 0 0 14px 22px; }
.legal-body li { margin-bottom: 6px; }
.legal-body a { color: var(--steel); }
.legal-body hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
.legal-body table { border-collapse: collapse; width: 100%; margin-bottom: 14px; font-size: 14px; }
.legal-body th,
.legal-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal-body th { background: var(--surface); font-weight: 600; }

.legal-empty {
    background: var(--surface);
    border: 1px dashed #c6c9cf;
    border-radius: var(--radius);
    padding: 20px;
    color: var(--ink-soft);
}

.legal-foot {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.legal-stamp { flex: 1; font-size: 12px; color: var(--ink-soft); }

.btn-close {
    padding: 10px 22px;
    border: none;
    border-radius: 2px;
    background: var(--navy);
    color: var(--white);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.btn-close:hover { background: #22317a; }

@media (max-width: 620px) {
    .legal-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
    .legal-head { padding: 14px 16px; }
    .legal-head h2 { font-size: 17px; }
    .legal-body { padding: 16px; font-size: 15px; }
    .legal-foot { padding: 12px 16px; }
    .btn-close { flex: 1; padding: 13px; }
}

/* Hintergrund nicht mitscrollen, solange ein Overlay offen ist */
html.has-modal,
html.has-modal body { overflow: hidden; }

/* ---------- Hinweis: keine Cookies ----------
   Erscheint unten, feuert zwei Konfetti-Kanonen und verschwindet nach fünf
   Sekunden von selbst. Der Knopf schliesst ihn sofort. */
.cookie-note {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    z-index: 90;

    display: flex;
    align-items: center;
    gap: 14px;
    width: min(560px, calc(100vw - 32px));
    padding: 14px 16px;

    background: var(--white);
    border: 1px solid var(--line);
    border-left: 4px solid var(--cyan);
    border-radius: 10px;
    box-shadow: 0 10px 34px rgba(16, 24, 40, .18);

    animation: cookie-in .38s cubic-bezier(.2, .8, .3, 1);
}
.cookie-note.is-leaving { animation: cookie-out .3s ease forwards; }

/* Startet bewusst nur leicht versetzt: läuft die Animation nicht durch,
   steht der Hinweis trotzdem lesbar da. Ein Start bei 130 % würde ihn
   ausserhalb des Bildschirms stehen lassen. */
@keyframes cookie-in { from { transform: translate(-50%, 18px); } }
@keyframes cookie-out { to { transform: translate(-50%, 130%); opacity: 0; } }

.cookie-note-icon { font-size: 24px; line-height: 1; flex-shrink: 0; }

.cookie-note-text {
    flex: 1;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--ink-soft);
    min-width: 0;
}
.cookie-note-text strong { display: block; color: var(--ink); font-size: 14.5px; }

.cookie-note-btn {
    flex-shrink: 0;
    padding: 10px 20px;
    min-height: 40px;
    border: none;
    border-radius: 6px;
    background: var(--navy);
    color: var(--white);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.cookie-note-btn:hover { background: #22317a; }

/* Konfetti liegt über allem, fängt aber keine Klicks ab. */
.confetti {
    position: fixed;
    inset: 0;
    z-index: 89;
    pointer-events: none;
}

@media (max-width: 560px) {
    /* Eine Zeile beibehalten — gestapelt würde der Hinweis unnötig hoch.
       Der Abstand nach unten bleibt grosszügig, damit er auch dann ganz
       sichtbar ist, wenn die Einblendung nicht durchläuft. */
    .cookie-note { bottom: 22px; gap: 11px; padding: 12px 13px; }
    .cookie-note-icon { font-size: 21px; }
    .cookie-note-text { font-size: 12.5px; }
    .cookie-note-text strong { font-size: 13.5px; }
    .cookie-note-btn { padding: 10px 16px; font-size: 13.5px; }
}

/* Auf sehr schmalen Geräten genügt die Kernaussage. */
@media (max-width: 420px) {
    .cookie-note-sub { display: none; }
}
