/* WSR Kundenportal */
:root {
  --espresso: #302A27;
  --leinen: #F9F6F4;
  --sand: #EDE7E2;
  --sand-2: #D6D0C8;
  --petrol: #006E81;
  --petrol-dark: #00586a;
  --petrol-tint: #e3f0f2;
  --text: #1A1A18;
  --text-2: #5d5753;
  --linie: #E4DCD5;
  --ok: #2e7d4f;
  --radius: 14px;
  --font: Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 18px; line-height: 1.6; color: var(--text); background: var(--leinen); }
button, input { font: inherit; color: inherit; }
h1, h2 { line-height: 1.2; margin: 0; font-weight: 700; }
p { margin: 0; }
a { color: var(--petrol); }
img { display: block; max-width: 100%; }
.boot { padding: 30vh 20px; text-align: center; color: var(--text-2); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 620px; }
.muted { color: var(--text-2); }
.small { font-size: .9rem; }
.stack > * + * { margin-top: 14px; }
.center { text-align: center; }

/* Kopf und Fuss */
.top { background: var(--espresso); display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; padding-top: max(12px, env(safe-area-inset-top)); }
.top .logo img { height: 40px; width: auto; }
.linkbtn { background: none; border: 0; padding: 6px 2px; color: inherit; text-decoration: underline; cursor: pointer; }
.top .linkbtn { color: #fff; opacity: .85; font-size: .95rem; }
.top .linkbtn:hover { opacity: 1; }
.foot { margin-top: 64px; padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linie); font-size: .85rem; color: var(--text-2); }
.foot p + p { margin-top: 6px; }
.foot a { color: var(--text-2); }

/* Begruessung / Anmeldung */
.welcome { background: linear-gradient(160deg, #3b3430 0%, var(--espresso) 55%, #1f1b19 100%); color: #fff; padding: 56px 0 96px; }
.welcome .eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; opacity: .75; margin-bottom: 14px; }
.welcome h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
.welcome .lead { margin-top: 14px; font-size: 1.1rem; opacity: .9; max-width: 34em; }
.card { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); padding: 28px; box-shadow: 0 10px 30px rgba(48, 42, 39, .08); }
.card.login { margin-top: -60px; position: relative; }
.card h2 { font-size: 1.35rem; margin-bottom: 10px; }
.card p + p, .card p + form, .card form + p { margin-top: 14px; }
.wrap > .card.center { margin-top: 40px; }
.card.center .btn { margin-top: 16px; }
.help { text-align: center; margin-top: 22px; color: var(--text-2); }
.field { display: block; }
.field > span { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.input { width: 100%; min-height: 56px; padding: 12px 16px; border: 1.5px solid var(--sand-2); border-radius: 10px; background: #fff; font-size: 1.1rem; }
.input:focus { outline: none; border-color: var(--petrol); box-shadow: 0 0 0 4px var(--petrol-tint); }
.input.code { text-align: center; letter-spacing: .35em; font-size: 1.6rem; font-weight: 700; font-family: Consolas, Menlo, monospace; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 12px 24px; border-radius: 10px; border: 1.5px solid var(--sand-2); background: #fff; font-weight: 700; font-size: 1.05rem; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.btn.primary:hover { background: var(--petrol-dark); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.block { width: 100%; }
:focus-visible { outline: 3px solid var(--petrol); outline-offset: 2px; }

/* Fahrzeug-Kopf */
.hero { position: relative; min-height: 380px; display: flex; align-items: flex-end; background: var(--espresso) center / cover no-repeat; color: #fff; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30, 26, 24, .15) 0%, rgba(30, 26, 24, .35) 45%, rgba(30, 26, 24, .88) 100%); }
.hero.plain { min-height: 260px; background: linear-gradient(160deg, #3b3430 0%, var(--espresso) 60%, #1f1b19 100%); }
.hero.plain::before { display: none; }
.hero-in { position: relative; width: 100%; padding-top: 28px; padding-bottom: 30px; }
.hero .back { display: inline-flex; align-items: center; gap: 4px; color: #fff; opacity: .85; text-decoration: none; margin-bottom: 18px; }
.hero .back svg { width: 20px; height: 20px; }
.hero .hello { font-size: 1.05rem; opacity: .9; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); margin-top: 4px; text-shadow: 0 2px 16px rgba(0, 0, 0, .35); }
.hero .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 14px; font-size: .95rem; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700; letter-spacing: .02em; }
.pill.ausbau { background: #E8A33D; color: #2b2116; }
.pill.fertig { background: #e2f1e8; color: var(--ok); }

.note { display: flex; gap: 14px; align-items: flex-start; margin-top: 24px; padding: 18px 20px; background: #fff; border: 1px solid var(--linie); border-left: 4px solid var(--petrol); border-radius: 10px; }
.note svg { width: 26px; height: 26px; flex: none; color: var(--petrol); margin-top: 2px; }
.note p + p { margin-top: 8px; }

/* Reiter */
.tabs { display: flex; gap: 6px; margin: 28px 0 8px; border-bottom: 2px solid var(--linie); overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: none; background: none; border: 0; padding: 14px 16px; font-weight: 700; color: var(--text-2); border-bottom: 3px solid transparent; margin-bottom: -2px; cursor: pointer; white-space: nowrap; min-height: 52px; }
.tabs button[aria-selected="true"] { color: var(--espresso); border-bottom-color: var(--petrol); }
.tabs .cnt { display: inline-block; min-width: 24px; padding: 0 7px; border-radius: 999px; background: var(--sand); font-size: .8rem; margin-left: 4px; }

/* Ausbau-Tagebuch */
.timeline { list-style: none; margin: 18px 0 0; padding: 0 0 0 26px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; background: var(--sand-2); }
.post { position: relative; padding-bottom: 44px; }
.post::before { content: ""; position: absolute; left: -26px; top: 7px; width: 16px; height: 16px; border-radius: 50%; background: var(--leinen); border: 3px solid var(--petrol); }
.post time { display: block; color: var(--text-2); font-size: .95rem; }
.post h2 { font-size: 1.4rem; margin-top: 2px; }
.post > p { margin-top: 8px; max-width: 42em; }
.gallery { display: grid; gap: 8px; margin-top: 16px; grid-template-columns: repeat(4, 1fr); }
.gallery button { position: relative; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--sand); cursor: zoom-in; aspect-ratio: 4 / 3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.gallery button:hover img { transform: scale(1.03); }
.gallery .more { display: none; }
.gallery button:first-child { grid-column: span 4; aspect-ratio: 16 / 9; }
.gallery.n2 button { grid-column: span 2; aspect-ratio: 4 / 3; }
.gallery.n3 button:not(:first-child) { grid-column: span 2; }
.gallery.n4 { grid-template-columns: repeat(3, 1fr); }
.gallery.n4 button:first-child { grid-column: span 3; }
.gallery.n4 button:not(:first-child) { grid-column: span 1; }
.gallery .plus { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(30, 26, 24, .55); color: #fff; font-size: 1.6rem; font-weight: 700; }

/* Unterlagen */
.docgroup { margin-top: 26px; }
.docgroup h2 { font-size: 1.1rem; color: var(--text-2); font-weight: 700; margin-bottom: 10px; }
.docs { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; }
.docs li + li { border-top: 1px solid var(--linie); }
.docs a { display: flex; align-items: center; gap: 16px; padding: 16px 18px; color: inherit; text-decoration: none; min-height: 72px; }
.docs a:hover { background: var(--leinen); }
.dic { flex: none; width: 46px; height: 46px; border-radius: 10px; background: var(--petrol-tint); color: var(--petrol); display: flex; align-items: center; justify-content: center; }
.dic svg { width: 26px; height: 26px; }
.dt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dt strong { overflow-wrap: anywhere; }
.dt .muted { font-size: .9rem; }
.open { flex: none; color: var(--petrol); font-weight: 700; }

/* Kontakt */
.contact { margin-top: 24px; }
.contact h2 { font-size: 1.4rem; }
.contact > p { margin: 6px 0 18px; color: var(--text-2); }
.cbtn { display: flex; align-items: center; gap: 16px; padding: 16px 18px; background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); color: inherit; text-decoration: none; min-height: 76px; }
.cbtn + .cbtn { margin-top: 10px; }
.cbtn svg { flex: none; width: 28px; height: 28px; color: var(--petrol); }
.cbtn span { display: flex; flex-direction: column; }
.cbtn:hover { border-color: var(--petrol); }

/* Leer */
.empty { text-align: center; padding: 48px 20px; }
.empty-ic { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; background: var(--sand); color: var(--text-2); display: flex; align-items: center; justify-content: center; }
.empty-ic svg { width: 34px; height: 34px; }
.empty h2 { font-size: 1.3rem; }
.empty p { margin: 8px auto 0; max-width: 30em; color: var(--text-2); }

/* Fahrzeugliste */
.vlist { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-top: -50px; position: relative; }
.vcard { display: block; background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none; box-shadow: 0 10px 30px rgba(48, 42, 39, .08); }
.vcard img, .vcard .ph { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.vcard .ph { background: var(--sand); color: var(--text-2); display: flex; align-items: center; justify-content: center; }
.vcard .ph svg { width: 40px; height: 40px; }
.vc-body { padding: 18px 20px 20px; }
.vc-body h2 { font-size: 1.25rem; margin-top: 8px; }

/* Bildansicht */
.lb { position: fixed; inset: 0; z-index: 50; background: rgba(15, 13, 12, .96); display: flex; align-items: center; justify-content: center; }
.lb img { max-width: 100vw; max-height: calc(100vh - 120px); object-fit: contain; }
.lb-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); color: #fff; font-size: .95rem; }
.lb-x, .lb-nav { background: rgba(255, 255, 255, .12); border: 0; color: #fff; width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.lb-x svg, .lb-nav svg { width: 26px; height: 26px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-nav.prev { left: 12px; }
.lb-nav.next { right: 12px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 32px); padding: 14px 20px; border-radius: 10px; background: var(--espresso); color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.toast.err { background: #b3261e; }

@media (max-width: 600px) {
  body { font-size: 17px; }
  .tabs { gap: 0; }
  .tabs button { flex: 1 1 auto; padding: 12px 8px; font-size: .95rem; }
  .card { padding: 22px; }
  .hero { min-height: 320px; }
  .gallery { gap: 6px; }
  .lb-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) { .gallery img { transition: none; } }
