/* Performance Calculator 2.0 - Systemschriften, keine externen Anfragen */
:root {
  --bg: #f2f5f9; --surface: #ffffff; --ink: #10243a; --muted: #57697c; --line: #d6dee7;
  --primary: #1b5fc1; --primary-ink: #ffffff; --taxi: #f4b400; --ok: #0b7a43; --bad: #b3261e;
  --field: #f7f9fc; --shadow: 0 1px 2px rgba(16,36,58,.06), 0 8px 24px rgba(16,36,58,.06);
  --head: "Bahnschrift", "DIN Alternate", "Segoe UI Semibold", system-ui, -apple-system, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1521; --surface: #112133; --ink: #e8eef5; --muted: #93a4b6; --line: #223548;
    --primary: #6aa8f2; --primary-ink: #06182c; --field: #0d1b2b; --ok: #4cc38a; --bad: #ff8a80;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .005em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.25rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; max-width: 62ch; }
a { color: var(--primary); }
.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: .5rem; }
:focus-visible { outline: 3px solid var(--taxi); outline-offset: 2px; border-radius: 4px; }

/* Kopfleiste */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; gap: 1.25rem; min-height: 60px; flex-wrap: wrap; padding-block: .35rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font: 600 1.05rem var(--head); color: var(--ink); text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 6px; background: var(--ink); position: relative; }
.brand-mark::after { content: ""; position: absolute; left: 50%; top: 4px; bottom: 4px; width: 3px; margin-left: -1.5px;
  background: repeating-linear-gradient(var(--taxi) 0 4px, transparent 4px 7px); }
.nav { display: flex; gap: .25rem; margin-right: auto; }
.nav a, .nav-off { padding: .45rem .8rem; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 500; }
.nav a:hover { background: var(--field); }
.nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--taxi); border-radius: 0; }
.nav-off { color: var(--muted); opacity: .6; cursor: not-allowed; }
.nav-off small { font-size: .75rem; margin-left: .25rem; }
.acct { display: flex; align-items: center; gap: .5rem; }
.acct form { margin: 0; }
.who { font-weight: 600; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1.1rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 .95rem var(--body); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--primary); }
.btn-primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-quiet { background: transparent; border-color: transparent; }
.btn-lg { padding: .85rem 1.5rem; font-size: 1.05rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Hinweise */
.notice { padding: .75rem 1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); margin: 1rem 0 0; max-width: none; }
.notice-ok { border-color: var(--ok); }
.notice-bad { border-color: var(--bad); color: var(--bad); }
.notice-warn { border-color: var(--taxi); }

/* Startseite */
.hero { padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.hero .lead { font-size: 1.15rem; color: var(--muted); }

/* Hero banner image */
.hero-img {
  position: relative;
  background-color: #081D37;           /* Füllfarbe links/rechts wenn Bild schmäler als Screen */
  background-size: cover;
  background-position: center 28%;
  background-repeat: no-repeat;
  margin-top: 2rem;
  margin-bottom: 3rem;
}
.hero-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    /* seitlicher Fade zu #081D37 – verdeckt den harten Bildrand nahtlos */
    linear-gradient(to right, #081D37 0%, transparent 12%, transparent 88%, #081D37 100%),
    /* dunkles Overlay links (Text) → heller rechts (FMC) */
    linear-gradient(110deg, rgba(6,18,44,.88) 0%, rgba(6,18,44,.78) 45%, rgba(6,18,44,.50) 75%, rgba(6,18,44,.35) 100%);
  pointer-events: none;
}
.hero-img .wrap { position: relative; z-index: 1; }
.hero-img h1 { color: #fff; }
.hero-img .lead { color: rgba(255,255,255,.82); }
.hero-img .fine { color: rgba(255,255,255,.6); }
.hero-img .btn:not(.btn-primary) {
  border-color: rgba(255,255,255,.35);
  background: rgba(255,255,255,.10);
  color: #fff;
  backdrop-filter: blur(4px);
}
.hero-img .btn:not(.btn-primary):hover {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.55);
}
/* Leaderboard ad: nur ab 760px anzeigen */
.ad-leader-wrap { display: none; }
@media (min-width: 760px) { .ad-leader-wrap { display: block; min-height: 90px; margin-bottom: 1.5rem; } }

.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.fine { color: var(--muted); font-size: .88rem; }
.tools { padding: 1rem 0 2.5rem; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.5rem; box-shadow: var(--shadow); }
.card h3 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.card-link { display: block; text-decoration: none; color: inherit; }
a.card-link:hover { border-color: var(--primary); }
.card-off { background: transparent; box-shadow: none; border-style: dashed; color: var(--muted); filter: grayscale(1); opacity: .75; cursor: not-allowed; }
.badge { font: 600 .75rem var(--body); padding: .15rem .55rem; border-radius: 99px; background: var(--taxi); color: #1b1500; }
.join { margin: 1rem 0 3rem; background: var(--ink); color: #eef3f8; border-radius: 20px; padding: clamp(1.5rem, 4vw, 2.75rem); display: grid;
  grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: center; position: relative; overflow: hidden; }
.join::before { content: ""; position: absolute; left: 0; right: 0; bottom: 14px; height: 4px;
  background: repeating-linear-gradient(90deg, var(--taxi) 0 36px, transparent 36px 64px); opacity: .9; }
.join h2 { color: #fff; }
.join p { color: #c4d1de; }
.join .btn { border-color: transparent; }
.join .btn-quiet { color: #eef3f8; border-color: #3a5169; }
@media (prefers-color-scheme: dark) { .join { background: #16304a; } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.steps li { display: flex; gap: .75rem; align-items: flex-start; }
.steps b { color: #fff; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--taxi); margin-top: .5rem; }

/* FMC-Anzeige (immer dunkel) */
.fmc { background: #000; color: #fff; border-radius: 10px; padding: .75rem .9rem 1rem; font: 700 1.05rem/1.2 var(--mono);
  box-shadow: 0 0 0 3px #1c2733, 0 12px 30px rgba(0,0,0,.35); user-select: none; max-width: 380px; width: 100%; }
.fmc-title { text-align: center; font-size: 1.1rem; padding-bottom: .5rem; }
.fmc-grid { display: grid; grid-template-columns: repeat(4, 1fr); column-gap: .25rem; }
.fmc .l { font-size: .68rem; letter-spacing: .12em; padding-top: .45rem; }
.fmc .v { font-size: 1.2rem; padding-bottom: .1rem; }
.fmc .s2 { grid-column: span 2; }
.fmc .r { text-align: right; }
.fmc .orange { color: #fe9a2e; } .fmc .green { color: #19d219; } .fmc .blue { color: #2eccfa; }
.fmc-sum { margin: .9rem 0 0; font-size: .95rem; color: var(--ink); font-family: var(--body); }
.fmc-sample { margin-top: .6rem; }

/* Tool-Seite */
.page-head { padding: 2rem 0 1rem; }
.page-head p { color: var(--muted); }
.tool { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 3rem; align-items: start; padding-bottom: 2.5rem; }
.tool-side { display: grid; gap: 1.25rem; position: sticky; top: 76px; }

/* Content pages with a sticky ad sidebar (weight-balance etc.) */
.page-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 3rem;
  align-items: start;
  width: min(1120px, 100% - 2rem);
  margin-inline: auto;
  padding-bottom: 2.5rem;
}
.page-with-sidebar > .page-main > .wrap { width: 100%; max-width: 100%; margin-inline: 0; }
.page-sidebar { position: sticky; top: 76px; }
@media (max-width: 920px) {
  .page-with-sidebar { grid-template-columns: 1fr; }
  .page-sidebar { display: none; }
}

fieldset { border: 0; margin: 0 0 1.5rem; padding: 0; min-width: 0; }
legend { font: 600 1.05rem var(--head); padding: 0; margin-bottom: .75rem; width: 100%; border-bottom: 2px solid var(--taxi); padding-bottom: .35rem; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem 1rem; }
.fld { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.fld.full { grid-column: 1 / -1; }
label, .lab { font-size: .88rem; font-weight: 600; }
.hint { font-size: .8rem; color: var(--muted); font-weight: 400; }
.row { display: flex; gap: .5rem; align-items: center; }
.row > input { flex: 1; min-width: 0; }
input[type=text], input[type=email], input[type=password], input[type=number], select {
  font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; width: 100%; min-height: 44px; }
input:focus, select:focus { border-color: var(--primary); }
select.unit { width: auto; flex: none; }
.icao { text-transform: uppercase; max-width: 6.5rem; letter-spacing: .08em; font-family: var(--mono); font-weight: 700; }
.apt-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .6rem; }
.status { font-size: .85rem; color: var(--muted); min-height: 1.2em; }
.status[data-kind="bad"]  { color: var(--bad); }
.status[data-kind="ok"]   { color: var(--ok); }
.status[data-kind="warn"] { color: #b45309; }
@media (prefers-color-scheme: dark) { .status[data-kind="warn"] { color: #fbbf24; } }
.metar { font: .8rem/1.4 var(--mono); color: var(--muted); word-break: break-word; margin: .6rem 0 0; max-width: none; }
.sb-bar { display: flex; align-items: center; gap: .85rem; flex-wrap: wrap; margin-top: .75rem; }
.sb-hint { margin-top: .5rem; }
.sb-bar .status { margin: 0; }
.sub { display: flex; justify-content: flex-end; margin-top: .5rem; }
.nudge h3 { margin-bottom: .35rem; }
.nudge .btn { margin-top: .25rem; }

/* Fixed side rail: appears at ≥ 1800 px where it fits without overlapping the 1120 px content column */
.ad-rail-left,
.ad-rail-right {
  display: none;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  z-index: 4;
}
@media (min-width: 1800px) {
  /* 50vw − 560px (half content) − 16px (gap) − 300px (ad) = 0 at 1752px; at 1800px = 24px clearance */
  .ad-rail-left  { display: block; left:  max(4px, calc(50vw - 924px)); }
  .ad-rail-right { display: block; right: max(4px, calc(50vw - 924px)); }
}

/* Auth */
.auth { width: min(440px, 100% - 2rem); margin: clamp(2rem, 8vw, 4.5rem) auto; }
.auth .fld { margin-bottom: 1rem; }
.auth .btn { width: 100%; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .9rem; }
.check input { width: auto; min-height: 0; margin-top: .25rem; }

/* Werbung (nur Tool-Seite) */
.ad-label {
  display: block;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  opacity: .55;
  margin: 0 0 .3rem;
}
.ad { display: flex; flex-direction: column; align-items: center; margin: 2.5rem 0 1.5rem; overflow: hidden; }
.ad::before {
  content: "Advertisement";
  display: block;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  opacity: .55;
  margin-bottom: .3rem;
}
.ad-empty::before,
.ad-empty .ad-label { display: none; }
.ad-side { display: none; }
.ad-result { margin: 2rem 0 0; }

/* Mobile Footer-Banner (sticky, nur auf kleinen Bildschirmen) */
.ad-mobile-footer {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  justify-content: center; align-items: center;
  background: var(--surface); border-top: 1px solid var(--line);
  min-height: 50px; padding: 2px 0;
}

/* Fuß */
.foot { border-top: 1px solid var(--line); padding: 1.5rem 0 2.5rem; color: var(--muted); font-size: .88rem; background: var(--surface); }
.foot p { margin: 0 0 .4rem; max-width: none; }
.foot a { color: var(--muted); }
.sim-note { color: var(--ink); font-weight: 600; }

/* Stats counter bar on homepage */
.stat-bar { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; align-items: center; padding: 1rem 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.stat-item { display: flex; flex-direction: column; gap: .15rem; }
.stat-num { font-size: 1.6rem; font-weight: 700; font-family: var(--head); line-height: 1; }
.stat-lbl { font-size: .78rem; color: var(--muted); }

/* Changelog */
.log h2 { margin-top: 1.5rem; font-size: 1.25rem; }
.log time { color: var(--muted); font-size: .88rem; }
.log ul { margin-top: .4rem; }

/* Account-Seite: SimBrief-Hint-Box */
.hint-box { border: 1px solid var(--line); border-radius: 10px; padding: .6rem 1rem; background: var(--field); }
.hint-box summary { cursor: pointer; font-weight: 600; color: var(--primary); user-select: none; }
.hint-box[open] summary { margin-bottom: .75rem; }
.hint-body ol, .hint-body ul { margin: 0 0 .5em; padding-left: 1.4em; }
.hint-body li { margin-bottom: .25em; }
.hint-body code { font-family: var(--mono); font-size: .9em; background: var(--line); padding: .1em .35em; border-radius: 4px; }

@media (max-width: 920px) {
  .hero-grid, .join, .tool { grid-template-columns: 1fr; }
  .tool-side { position: static; }
  .fmc { max-width: none; }
}
@media (max-width: 560px) {
  .fgrid { grid-template-columns: 1fr; }
  .acct .who { display: none; }
  .nav { order: 3; width: 100%; }
}
@media (max-width: 760px) {
  .ad-mobile-footer { display: flex; }
  body { padding-bottom: 58px; } /* Platz für sticky footer banner */
}
@media (min-width: 920px) {
  .ad-side { display: block; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
