/* ==========================================================================
   kontakt – styles
   Same refined frame as immobilienrechner (v3.0.4): values and classes are
   copied 1:1 from Z:\immobilienrechner\assets\css\app.css – keep in sync.
   Below the shared part: the form's own pieces (drop zone, file list,
   upload progress, download page) in the same style.
   Colors live in tokens.css; the block below only fine-tunes them.
   ========================================================================== */

:root {
  /* slightly larger type: easier on every age group */
  --fs-xs: .8125rem;
  --fs-sm: .875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-3xl: clamp(2rem, 1.45rem + 2.1vw, 3rem);

  --r-sm: 7px;
  --r: 10px;
  --r-lg: 18px;

  --content-max: 1280px;
  --aside-w: 340px;
  --topbar-total: 83px;
  interpolate-size: allow-keywords;
}
:root,
:root[data-theme="light"] {
  --hairline: rgba(28, 26, 26, .06);
  --e-card: 0 1px 2px rgba(28, 26, 26, .04), 0 12px 32px -18px rgba(28, 26, 26, .16);
  --e-raised: 0 1px 2px rgba(28, 26, 26, .06), 0 4px 10px -4px rgba(28, 26, 26, .10);
  --e-input: 0 1px 2px rgba(28, 26, 26, .05);
  --focus: #1d5fb4;                      /* focus in CD-ish blue – red stays reserved for errors and the brand */
  --focus-soft: rgba(29, 95, 180, .16);
  --glow-a: rgba(247, 166, 0, .10);
  --glow-b: rgba(213, 19, 23, .045);
}
:root[data-theme="dark"] {
  --hairline: rgba(255, 255, 255, .06);
  --e-card: 0 1px 2px rgba(0, 0, 0, .5), 0 18px 40px -22px rgba(0, 0, 0, .9);
  --e-raised: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 14px -6px rgba(0, 0, 0, .7);
  --e-input: 0 1px 2px rgba(0, 0, 0, .35);
  --focus: #6ea6ee;
  --focus-soft: rgba(110, 166, 238, .22);
  --glow-a: rgba(247, 166, 0, .07);
  --glow-b: rgba(213, 19, 23, .07);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 110px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 88% -120px, var(--glow-a), transparent 65%),
    radial-gradient(900px 480px at -5% -80px, var(--glow-b), transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.2; color: var(--heading); letter-spacing: -.015em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
b, strong { font-weight: 650; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.i-sm { width: 17px; height: 17px; }
svg.i-xs { width: 13px; height: 13px; stroke-width: 2.5; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--cd-yellow) 35%, transparent); }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0ms !important; animation-duration: 0ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; }
}

.skip { position: absolute; left: 16px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-lg); font-weight: 600; }
.skip:focus { top: 12px; }

/* --------------------------------------------------------------------------
   Grid: main + aside (hero and form share the same column edge)
   -------------------------------------------------------------------------- */
.grid { display: grid; gap: var(--gap); }
.grid > * { min-width: 0; }
.grid-main { grid-template-columns: minmax(0, 1fr) var(--aside-w); align-items: start; }

/* --------------------------------------------------------------------------
   Header / footer
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--t), background var(--t);
}
.topbar::before {
  /* red → yellow, same split as in the logo */
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--cd-red) 0 62%, var(--cd-yellow) 62% 100%);
}
.topbar.is-stuck { background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: 0 12px 32px -22px rgba(28, 26, 26, .45); }
.topbar-inner, .footer-inner, .content { width: 100%; max-width: var(--content-max); margin: 0 auto; padding-left: var(--s-8); padding-right: var(--s-8); }
.topbar-inner { display: flex; align-items: center; gap: var(--s-3); height: 80px; }
.topbar-spacer { flex: 1; }

/* logo: original file, scale proportionally only – CD says hands off */
.brand { display: flex; align-items: center; flex: none; border-radius: var(--r-sm); }
.brand-logo { display: block; width: auto; height: 56px; }
.brand-logo.on-dark { display: none; height: 36px; }
:root[data-theme="dark"] .brand-logo.on-light { display: none; }
:root[data-theme="dark"] .brand-logo.on-dark { display: block; }

.app-name, .app-name:hover { display: flex; flex-direction: column; justify-content: center; margin-left: var(--s-6); padding-left: var(--s-6); min-height: 44px; border-left: 1px solid var(--border-strong); color: var(--heading); text-decoration: none; line-height: 1.25; white-space: nowrap; }
.app-name strong { font-family: var(--font-display); font-weight: 650; font-size: var(--fs-lg); letter-spacing: -.01em; }
.app-name span { font-size: var(--fs-xs); color: var(--text-3); }

/* kontakt only: "encrypted connection" pill in the header */
.secure-badge { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 10px; border-radius: var(--r-full); background: var(--ok-soft); color: var(--ok); font-size: var(--fs-xs); font-weight: 650; letter-spacing: .02em; }

.icon-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r); color: var(--text-2); transition: background var(--t-fast), color var(--t-fast); }
.icon-btn:hover { color: var(--text); background: var(--surface-hover); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }

.content { flex: 1; display: flex; flex-direction: column; gap: var(--gap); padding-top: var(--s-8); padding-bottom: 72px; }

/* blocks rise in gently on load */
@media (prefers-reduced-motion: no-preference) {
  .content > * { animation: rise .55s var(--ease) both; }
  .content > :nth-child(2) { animation-delay: .06s; }
  .content > :nth-child(3) { animation-delay: .12s; }
  .content > :nth-child(4) { animation-delay: .18s; }
  .content > :nth-child(n+5) { animation-delay: .24s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.footer { border-top: 1px solid var(--border); background: var(--surface); font-size: var(--fs-sm); color: var(--text-3); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-6); padding-top: var(--s-6); padding-bottom: calc(var(--s-6) + env(safe-area-inset-bottom)); }
.footer a { color: var(--text-2); text-decoration: none; }
.footer a:hover { color: var(--accent-ink); text-decoration: underline; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s-5); }
/* version + my little dev tag – low-key by default, color only on hover */
.footer-version { margin-left: auto; display: inline-flex; align-items: center; gap: var(--s-4); }
.footer-version .ver { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); }
.dev-tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: var(--r-xs); border: 1px solid transparent; font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; color: var(--text-3); cursor: default; outline-offset: 2px; transition: border-color var(--t), background var(--t), color var(--t), box-shadow var(--t); }
.dev-rays { width: 14px; height: 12px; flex: none; overflow: visible; }
.dev-rays path { transform-box: fill-box; transform-origin: 50% 100%; fill: var(--text-3); opacity: .6; transition: fill var(--t), opacity var(--t); }
.dev-tag.is-open { background: var(--surface-2); border-color: color-mix(in srgb, var(--cd-red) 40%, var(--border)); color: var(--text); box-shadow: 0 0 0 3px var(--red-soft); }
.dev-tag.is-open .ray-red { fill: var(--cd-red); opacity: 1; }
.dev-tag.is-open .ray-yellow { fill: var(--cd-yellow); opacity: 1; }
.dev-name { display: inline-block; max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; transition: max-width .45s var(--ease), opacity .3s; }
.dev-tag.is-open .dev-initials { display: none; }
.dev-tag.is-open .dev-name { max-width: 20ch; opacity: 1; }
/* heartbeat: red = lub, yellow = dub – swell with ease-out, settle with ease-in, then rest */
.dev-tag.is-open .ray-red    { animation: beat-lub 1.6s infinite; }
.dev-tag.is-open .ray-yellow { animation: beat-dub 1.6s infinite; }
@keyframes beat-lub {
  0%   { transform: scale(1);    animation-timing-function: ease-out; }
  16%  { transform: scale(1.22); animation-timing-function: ease-in; }
  36%  { transform: scale(1); }
  100% { transform: scale(1); }
}
@keyframes beat-dub {
  0%, 18% { transform: scale(1);    animation-timing-function: ease-out; }
  34%     { transform: scale(1.18); animation-timing-function: ease-in; }
  54%     { transform: scale(1); }
  100%    { transform: scale(1); }
}

/* --------------------------------------------------------------------------
   Hero: light and calm; CD via accent line, ray sun and warm glow
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--aside-w);
  gap: var(--gap);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(620px 300px at 100% 0%, var(--glow-a), transparent 70%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--e-card);
  overflow: hidden;
  isolation: isolate;
}
.hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--cd-red) 0 62%, var(--cd-yellow) 62% 100%); }
.hero-sun { position: absolute; z-index: -1; width: 600px; height: 600px; right: -190px; top: 50%; transform: translateY(-50%); color: var(--cd-red); opacity: .045; animation: sun-turn 240s linear infinite; }
.hero-sun.small { width: 190px; height: 190px; right: auto; left: -74px; top: auto; bottom: -96px; transform: none; color: var(--cd-yellow); opacity: .2; animation-direction: reverse; }
:root[data-theme="dark"] .hero-sun { opacity: .08; }
:root[data-theme="dark"] .hero-sun.small { opacity: .2; }
@keyframes sun-turn { to { rotate: 360deg; } }

.hero-main { padding: 52px var(--s-10) 48px; }
.hero-side { display: flex; flex-direction: column; justify-content: center; gap: var(--s-2); padding: var(--s-8) var(--s-8) var(--s-8) 0; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 10px; border-radius: var(--r-full); background: var(--accent-soft); font-size: var(--fs-xs); font-weight: 650; letter-spacing: .02em; color: var(--accent-ink); }
.hero-eyebrow .rays { width: 15px; height: 13px; }
.hero-eyebrow.is-ok { background: var(--ok-soft); color: var(--ok); }
.hero h1 { margin-top: var(--s-4); font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -.028em; line-height: 1.08; }
.hero-lead { margin-top: var(--s-4); font-size: var(--fs-lg); line-height: 1.6; color: var(--text-2); }
.hero-lead b, .hero-lead strong { color: var(--text); overflow-wrap: anywhere; }
.hero-side-title { font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: var(--s-1); }

/* trust line under the lead */
.hero-trust { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); margin: var(--s-6) 0 0; padding: 0; list-style: none; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.hero-trust li { display: inline-flex; align-items: center; gap: 8px; }
.hero-trust .i { width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); stroke-width: 3; }

.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-8); }

/* single-column hero for message and download pages */
.hero-message { grid-template-columns: minmax(0, 1fr); }
.hero-message .hero-main { padding: 56px var(--s-10) 52px; }
.ic-xl { width: 60px; height: 60px; border-radius: 16px; margin-bottom: var(--s-5); box-shadow: var(--e-input); }
.ic-xl svg { width: 28px; height: 28px; }

.glance { display: flex; align-items: center; gap: var(--s-3); min-height: 66px; padding: var(--s-3) var(--s-4) var(--s-3) var(--s-3); border-radius: var(--r); border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: var(--e-input); }
.glance .ic { width: 40px; height: 40px; }
.glance .step-no { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md); }
.glance-body { flex: 1; min-width: 0; line-height: 1.3; }
.glance-body > * { display: block; }
.glance-body strong { font-size: var(--fs-sm); font-weight: 650; }
.glance-body span { font-size: var(--fs-xs); color: var(--text-3); }

/* --------------------------------------------------------------------------
   Cards, lists, icon tiles, badges
   -------------------------------------------------------------------------- */
.card { position: relative; display: flex; flex-direction: column; padding: var(--s-10); border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--e-card); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.card-head h3 { font-size: var(--fs-lg); font-weight: 650; }
.card-sub { margin-top: 4px; font-size: var(--fs-sm); color: var(--text-3); }

.form-aside { padding: var(--s-6); position: sticky; top: calc(var(--topbar-total) + var(--s-6)); overflow: hidden; }
.form-aside::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--surface-sunken); }

.rows { display: flex; flex-direction: column; margin-top: var(--s-4); }
.card-head + .rows { margin-top: 0; }
.row { display: flex; align-items: center; gap: var(--s-3); min-height: 58px; padding: 10px 0; border-top: 1px solid var(--border); font-size: var(--fs-sm); }
.row-main { flex: 1; min-width: 0; line-height: 1.35; }
.row-main strong { display: block; font-weight: 650; color: var(--text); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.row-main span { color: var(--text-3); font-size: var(--fs-xs); }
.row-val { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row .ic { width: 36px; height: 36px; align-self: center; }
.row .ic svg { width: 18px; height: 18px; }

.aside-block { margin-top: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--border); }
.aside-label { margin-bottom: var(--s-3); font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.ext-list { display: flex; flex-wrap: wrap; gap: 6px; }

.ic { display: grid; place-items: center; flex: none; border-radius: var(--r); }
.ic-red    { background: var(--red-soft);    color: var(--red-ink); }
.ic-yellow { background: var(--yellow-soft); color: var(--yellow-ink); }
.ic-grey   { background: var(--grey-soft);   color: var(--grey-ink); }
.ic-blue   { background: var(--blue-soft);   color: var(--blue-ink); }
.ic-green  { background: var(--green-soft);  color: var(--green-ink); }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--r-full); font-size: 11.5px; font-weight: 650; white-space: nowrap; background: var(--surface-sunken); color: var(--text-2); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }

/* --------------------------------------------------------------------------
   Buttons – color = meaning: green = send/add, yellow = change, red = remove,
   blue = navigation, white = everything else; the icon carries the color
   -------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); height: 44px; padding: 0 18px; border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; text-decoration: none; box-shadow: var(--e-input); transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast); }
.btn:hover { text-decoration: none; box-shadow: var(--e-raised); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: var(--e-input); }
.btn-lg { height: 54px; padding: 0 28px; font-size: var(--fs-md); font-weight: 650; border-radius: 12px; }
.btn-ok   { --tone: var(--ok);   --tone-soft: var(--ok-soft); }
.btn-warn { --tone: var(--warn); --tone-soft: var(--warn-soft); }
.btn-crit { --tone: var(--crit); --tone-soft: var(--crit-soft); }
.btn-info { --tone: var(--info); --tone-soft: var(--info-soft); }
.btn-ok .i, .btn-warn .i, .btn-crit .i, .btn-info .i { color: var(--tone); }
.btn-ok:hover, .btn-warn:hover, .btn-crit:hover, .btn-info:hover { background: var(--tone-soft); border-color: color-mix(in srgb, var(--tone) 40%, var(--border-strong)); }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-solid { color: #fff; }
.btn-solid .i { color: inherit; }
.btn-ok.btn-solid { border-color: var(--ok-solid); background: linear-gradient(180deg, color-mix(in srgb, var(--ok-solid) 86%, #fff), var(--ok-solid)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px rgba(28, 26, 26, .2), 0 10px 22px -10px color-mix(in srgb, var(--ok-solid) 80%, transparent); }
.btn-ok.btn-solid:hover { background: linear-gradient(180deg, var(--ok-solid), var(--ok-solid-hover)); border-color: var(--ok-solid-hover); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 2px 4px rgba(28, 26, 26, .2), 0 14px 26px -10px color-mix(in srgb, var(--ok-solid) 85%, transparent); }
/* kontakt only: the download button is the one blue main action – same depth as the green one */
.btn-info.btn-solid { border-color: var(--info-solid); background: linear-gradient(180deg, color-mix(in srgb, var(--info-solid) 86%, #fff), var(--info-solid)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px rgba(28, 26, 26, .2), 0 10px 22px -10px color-mix(in srgb, var(--info-solid) 80%, transparent); }
.btn-info.btn-solid:hover { background: linear-gradient(180deg, var(--info-solid), var(--info-solid-hover)); border-color: var(--info-solid-hover); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 2px 4px rgba(28, 26, 26, .2), 0 14px 26px -10px color-mix(in srgb, var(--info-solid) 85%, transparent); }
.btn:disabled, .btn:disabled:hover { opacity: .6; cursor: progress; transform: none; box-shadow: var(--e-input); }
.btn .i-go { transition: transform var(--t) var(--ease); }
.btn:hover .i-go { transform: translateX(3px); }

/* remove a file: red, fills on hover so it's obvious */
.icon-btn.btn-crit { width: 34px; height: 34px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--crit); box-shadow: var(--e-input); }
.icon-btn.btn-crit:hover { background: var(--crit-solid); border-color: var(--crit-solid); color: #fff; }
.icon-btn.btn-crit .i { width: 15px; height: 15px; }

/* --------------------------------------------------------------------------
   Notes (always full width): bold title + one paragraph
   -------------------------------------------------------------------------- */
.note { display: flex; gap: var(--s-3); padding: 14px 18px; border-radius: var(--r); font-size: var(--fs-sm); line-height: 1.55; border: 1px solid transparent; }
.note > .i { margin-top: 1px; }
.note p + p { margin-top: var(--s-2); }
.note-stack { padding: 18px 22px; }
.note-title { display: block; margin-bottom: 4px; font-size: var(--fs-md); }
.note a { color: inherit; font-weight: 650; }
.note-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 12%, transparent); }
.note-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 14%, transparent); }
.note-ok   { background: var(--ok-soft);   color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 14%, transparent); }
.note-crit { background: var(--crit-soft); color: var(--crit); border-color: color-mix(in srgb, var(--crit) 14%, transparent); }
.note-list { margin: 6px 0 0; padding-left: 18px; }
.note-list li + li { margin-top: 2px; }
.note-list b { overflow-wrap: anywhere; }

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */
.form-section + .form-section { margin-top: var(--s-10); padding-top: var(--s-10); border-top: 1px solid var(--border); }
.form-section-head { margin-bottom: var(--s-6); }
.form-section-head h3 { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-xl); font-weight: 650; letter-spacing: -.02em; }
.form-section-head p { margin-top: 6px; font-size: var(--fs-md); color: var(--text-2); }
.rays { width: 22px; height: 19px; flex: none; }

.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-6); }
.field { display: flex; flex-direction: column; gap: 8px; grid-column: span 2; min-width: 0; }
.field.w4 { grid-column: span 4; }

.label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 650; color: var(--text); }
.label .req { color: var(--crit); font-weight: 500; }
.hint { font-size: var(--fs-xs); line-height: 1.5; color: var(--text-3); }

.input, .textarea { width: 100%; height: 52px; padding: 0 var(--s-4); border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 1.0625rem; font-weight: 500; font-variant-numeric: tabular-nums; box-shadow: var(--e-input); transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast); }
.textarea { height: auto; min-height: 156px; padding: 14px var(--s-4); resize: vertical; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); font-weight: 400; opacity: .8; }
.input:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .textarea:focus { outline: 0; border-color: var(--focus); box-shadow: 0 0 0 4px var(--focus-soft); }
.input-short { max-width: 260px; }

.input-icon { position: relative; }
.input-icon > .i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; transition: color var(--t-fast); }
.input-icon .input { padding-left: 46px; }
.input-icon:focus-within > .i { color: var(--focus); }

.field-foot { display: flex; align-items: flex-start; gap: var(--s-3); }
.field-foot .counter { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.counter.is-low { color: var(--warn); font-weight: 650; }

.field-error { display: none; font-size: var(--fs-xs); font-weight: 650; color: var(--crit); }
.field.is-invalid .input, .field.is-invalid .textarea { border-color: var(--crit-dot); background: color-mix(in srgb, var(--crit-soft) 45%, var(--surface)); }
.field.is-invalid .input:focus, .field.is-invalid .textarea:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--crit-dot) 18%, transparent); }
.field.is-invalid .input-icon > .i { color: var(--crit); }
.field.is-invalid .dropzone { border-color: var(--crit-dot); background: color-mix(in srgb, var(--crit-soft) 45%, var(--surface)); }
.field.is-invalid .field-error { display: block; animation: step-in .25s var(--ease); }

/* honeypot – invisible for humans */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-actions { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-10); padding-top: var(--s-8); border-top: 1px solid var(--border); }
.form-actions .spacer { flex: 1; }
.form-actions > .hint { display: flex; align-items: flex-start; gap: 8px; max-width: 52%; }
.form-actions > .hint .i { margin-top: 1px; color: var(--ok-dot); }
.card-foot.form-actions { margin-top: var(--s-8); padding-top: var(--s-6); }

@keyframes step-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   kontakt only: drop zone, file list, upload progress
   -------------------------------------------------------------------------- */
.dropzone {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-5);
  min-height: 128px;
  padding: var(--s-6) var(--s-8);
  border-radius: var(--r-lg);
  border: 2px dashed var(--border-strong);
  background:
    radial-gradient(420px 160px at 100% 0%, var(--glow-a), transparent 70%),
    var(--surface-2);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--focus); background: color-mix(in srgb, var(--focus-soft) 40%, var(--surface)); }
.dropzone.is-over { box-shadow: 0 0 0 4px var(--focus-soft); }
.dropzone:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.dropzone .ic { width: 56px; height: 56px; border-radius: 14px; box-shadow: var(--e-input); transition: transform var(--t) var(--ease); }
.dropzone .ic svg { width: 26px; height: 26px; }
.dropzone:hover .ic, .dropzone.is-over .ic { transform: translateY(-2px); }
.dropzone-text strong { display: block; font-size: var(--fs-lg); font-weight: 650; color: var(--text); }
.dropzone-text strong u { color: var(--focus); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.dropzone-text span { font-size: var(--fs-sm); color: var(--text-3); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
/* no JS: keep the plain file input visible */
html:not(.js) .dropzone input[type="file"] { position: static; width: auto; height: auto; opacity: 1; margin-left: auto; }

.file-list { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.file-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 34px; align-items: center; gap: var(--s-3); min-height: 62px; padding: 10px var(--s-3) 10px 10px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--e-input); animation: step-in .25s var(--ease); }
.file-item .ic { width: 40px; height: 40px; }
.file-item .ic svg { width: 19px; height: 19px; }
.file-name { font-size: var(--fs-sm); font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-problem { display: block; font-size: var(--fs-xs); font-weight: 650; color: var(--crit); white-space: normal; }
.file-size { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.file-item.is-bad { border-color: color-mix(in srgb, var(--crit-dot) 55%, var(--border)); background: color-mix(in srgb, var(--crit-soft) 45%, var(--surface)); }
.file-sum { display: flex; justify-content: space-between; gap: var(--s-3); padding: 0 2px; font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.file-sum.is-over { color: var(--crit); font-weight: 650; }

/* progress: same look as the <progress> bar in immobilienrechner */
.upload-progress { margin-top: var(--s-10); padding: var(--s-5); border-radius: var(--r); border: 1px solid var(--border); background: linear-gradient(180deg, var(--surface-2), var(--surface)); box-shadow: var(--e-input); }
.upload-progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); margin-bottom: var(--s-2); font-size: var(--fs-sm); }
.upload-progress-head span { font-size: var(--fs-xs); font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 650; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-sunken); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--cd-red), var(--cd-yellow)); transition: width var(--t) var(--ease); }
.upload-progress .hint { margin-top: var(--s-3); }

/* --------------------------------------------------------------------------
   kontakt only: download page
   -------------------------------------------------------------------------- */
.file-title { overflow-wrap: anywhere; }
.download-note { margin-top: var(--s-6); }
.dl .upload-progress { margin-top: var(--s-6); }
.dl [data-state="done"] { animation: step-in .3s var(--ease); }
.dl-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); margin-top: var(--s-6); }
.dl-hint { margin-top: var(--s-3); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .form-aside { position: static; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero-main { padding-bottom: var(--s-6); }
  .hero-side { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 var(--s-10) var(--s-10); }
  .hero-side-title { grid-column: 1 / -1; }
  .hero-ok .hero-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  :root { --gap: 16px; --topbar-total: 71px; }
  .topbar-inner, .footer-inner, .content { padding-left: var(--s-4); padding-right: var(--s-4); }
  .content { padding-top: var(--s-5); padding-bottom: var(--s-12); }
  .topbar-inner { height: 68px; }
  .brand-logo { height: 44px; }
  .brand-logo.on-dark { height: 30px; }
  .app-name { margin-left: var(--s-4); padding-left: var(--s-4); }
  .app-name strong { font-size: var(--fs-md); }
  .app-name span { display: none; }
  .secure-badge { width: 30px; padding: 0; justify-content: center; }
  .secure-badge span { display: none; }
  .card { padding: var(--s-6) var(--s-5); }
  .hero-main, .hero-message .hero-main { padding: 36px var(--s-5) var(--s-5); }
  .hero-side, .hero-ok .hero-side { grid-template-columns: minmax(0, 1fr); padding: 0 var(--s-5) var(--s-6); }
  .hero-sun { width: 420px; height: 420px; right: -210px; }
  .hero-trust { gap: var(--s-2) var(--s-4); }
  .form-section + .form-section { margin-top: var(--s-8); padding-top: var(--s-8); }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .field, .field.w4 { grid-column: auto; }
  .input-short { max-width: none; }
  .dropzone { flex-direction: column; text-align: center; padding: var(--s-6) var(--s-5); }
  .form-actions { flex-direction: column-reverse; align-items: stretch; margin-top: var(--s-8); padding-top: var(--s-6); }
  .form-actions > .hint { max-width: none; }
  .form-actions .spacer { display: none; }
  .form-actions .btn, .hero-actions .btn { width: 100%; }
  .file-item { grid-template-columns: 40px minmax(0, 1fr) 34px; }
  .file-size { grid-column: 2; grid-row: 2; margin-top: -6px; }
  .file-item .icon-btn { grid-column: 3; grid-row: 1 / span 2; }
  .dl-steps { grid-template-columns: minmax(0, 1fr); }
  .footer-version { margin-left: 0; }
}
