/* ==========================================================================
   metatrader-5-kosten.de — design system
   Concept: "Kostenbeleg" — the page reads like a financial cost statement /
   trading confirmation slip. Ledger rows, ink-stamp badges, tabular data.
   ========================================================================== */

:root {
  /* Color tokens */
  --paper: #edefea;
  --paper-raised: #f7f8f3;
  --paper-deep: #e3e6dd;
  --ink: #161d2b;
  --ink-soft: #4a5266;
  --ink-faint: #7b8296;
  --line: #c7cbbf;
  --line-soft: #dcded4;
  --navy: #1f2a44;
  --navy-deep: #141b30;
  --stamp: #b23a2e;
  --stamp-soft: #f1d9d4;
  --brass: #8c6a32;
  --brass-soft: #efe4c9;
  --ledger-green: #2f6d4f;
  --ledger-green-soft: #dbe9df;

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", ui-serif, Georgia, serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* Scale */
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --step-1: clamp(1.15rem, 1.05rem + 0.5vw, 1.3rem);
  --step-2: clamp(1.4rem, 1.2rem + 1vw, 1.75rem);
  --step-3: clamp(1.9rem, 1.5rem + 1.8vw, 2.6rem);
  --step-4: clamp(2.4rem, 1.8rem + 3vw, 3.6rem);

  --container: 1120px;
  --radius: 14px;
  --radius-sm: 8px;

  --shadow-card: 0 1px 2px rgba(22, 29, 43, 0.06), 0 8px 24px -12px rgba(22, 29, 43, 0.18);
  --shadow-lift: 0 2px 4px rgba(22, 29, 43, 0.08), 0 16px 32px -16px rgba(22, 29, 43, 0.24);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
ul, ol { padding-left: 1.25em; }
table { border-collapse: collapse; width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; color: var(--ink); }
p { margin: 0 0 1em; }
:focus-visible {
  outline: 3px solid var(--stamp);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6em 1em;
  z-index: 1000;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ==========================================================================
   Header / masthead
   ========================================================================== */
.masthead {
  background: var(--navy);
  color: var(--paper);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.masthead .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--paper);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
}
.brand-mark { width: 28px; height: 28px; flex-shrink: 0; }
.brand-mark path, .brand-mark circle, .brand-mark rect { stroke: var(--paper); }
.brand span { overflow: hidden; text-overflow: ellipsis; }

.nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  flex-shrink: 0;
}
.nav-list {
  display: flex;
  gap: 1.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-list a {
  font-size: 0.92rem;
  text-decoration: none;
  color: rgba(237,239,234,0.82);
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.nav-list a:hover { color: var(--paper); }
.nav-list a[aria-current="page"] {
  color: var(--paper);
  border-bottom-color: var(--stamp);
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(237,239,234,0.35);
  border-radius: var(--radius-sm);
  color: var(--paper);
  width: 42px;
  height: 38px;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav { position: static; gap: 0.8rem; }
  .nav-list {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--navy-deep);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
    display: none;
  }
  .nav-list.is-open { display: flex; }
  .nav-list a { display: block; padding: 0.7rem 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
}
@media (max-width: 420px) {
  .masthead .container { padding: 0 1rem; gap: 0.6rem; }
  .brand { font-size: 0.98rem; gap: 0.4rem; }
  .brand-mark { width: 22px; height: 22px; }
}

/* ==========================================================================
   Hero — "Kostenbeleg" receipt component (signature element)
   ========================================================================== */
.hero {
  padding: 3.2rem 0 2.4rem;
  position: relative;
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; gap: 2rem; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stamp);
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--stamp);
  border-radius: 50%;
  display: inline-block;
}

.hero h1 {
  font-size: var(--step-4);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}
.hero h1 em {
  font-style: normal;
  color: var(--stamp);
  font-variation-settings: "opsz" 40;
}
.hero-lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 40em;
  margin-bottom: 1.6rem;
}
.stand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35em 0.9em;
  margin-bottom: 1.6rem;
}

/* the receipt card */
.receipt {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  position: relative;
  padding: 1.6rem 1.6rem 1.4rem;
  animation: stamp-land 0.5s var(--ease) both;
}
@keyframes stamp-land {
  from { opacity: 0; transform: translateY(10px) rotate(-1.2deg) scale(0.98); }
  to { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
}
.receipt::before {
  /* perforated top edge */
  content: "";
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 10px;
  background-image: radial-gradient(circle at 10px 0, transparent 5px, var(--paper) 5.5px);
  background-size: 20px 10px;
  background-repeat: repeat-x;
}
.receipt-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px dashed var(--line);
  padding-bottom: 0.8rem;
  margin-bottom: 0.8rem;
}
.receipt-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}
.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 0.95rem;
}
.receipt-row:last-of-type { border-bottom: none; }
.receipt-row dt { color: var(--ink-soft); }
.receipt-row dd {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}
.receipt-row dd.is-zero { color: var(--ledger-green); }
.receipt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}
.stamp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--stamp);
  border: 1.5px solid var(--stamp);
  border-radius: 999px;
  padding: 0.3em 0.8em;
  transform: rotate(-3deg);
}
.receipt-barcode {
  height: 22px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 5px, var(--ink) 5px 6px, transparent 6px 11px, var(--ink) 11px 13px, transparent 13px 17px);
  opacity: 0.55;
  margin-top: 1rem;
}

/* ==========================================================================
   CTA blocks
   ========================================================================== */
.cta-block {
  background: var(--navy);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 1.8rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 2.4rem 0;
}
.cta-block.is-flat {
  background: var(--paper-raised);
  color: var(--ink);
  border: 1.5px solid var(--navy);
}
.cta-copy h3 { font-size: 1.2rem; margin-bottom: 0.3rem; }
.cta-copy p { color: rgba(237,239,234,0.78); margin: 0; font-size: 0.95rem; }
.cta-block.is-flat .cta-copy p { color: var(--ink-soft); }

@media (max-width: 620px) {
  .cta-block {
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
    gap: 1.1rem;
  }
  .cta-block .btn {
    justify-content: center;
    white-space: normal;
    text-align: center;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: var(--stamp);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.75em 1.3em;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  box-shadow: var(--shadow-card);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.is-ghost {
  background: transparent;
  border: 1.5px solid currentColor;
  color: inherit;
}

/* ==========================================================================
   Sections / prose
   ========================================================================== */
.section {
  padding: 2.6rem 0;
  border-top: 1px solid var(--line-soft);
}
.section > .container > h2 {
  font-size: var(--step-3);
  font-weight: 600;
  margin-bottom: 0.6rem;
  max-width: 30em;
}
.section > .container > h3 {
  font-size: var(--step-2);
  font-weight: 600;
  margin: 1.8rem 0 0.6rem;
}
.section-lede {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 42em;
  margin-bottom: 1.4rem;
}
.prose { max-width: 42em; }
.prose p { color: var(--ink-soft); }
.prose a { color: var(--navy); text-decoration-color: var(--stamp); text-decoration-thickness: 2px; }

/* ==========================================================================
   Ledger table (infographic: cost breakdown)
   ========================================================================== */
.ledger-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  box-shadow: var(--shadow-card);
}
table.ledger {
  min-width: 620px;
}
table.ledger caption {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0.9rem 1.2rem 0;
}
table.ledger th, table.ledger td {
  text-align: left;
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.92rem;
}
table.ledger thead th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
}
table.ledger td.num, table.ledger th.num {
  font-family: var(--font-mono);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.ledger tbody tr:last-child td { border-bottom: none; }
table.ledger tbody tr:hover { background: rgba(140, 106, 50, 0.06); }
table.ledger td.entity { font-weight: 600; }
table.ledger .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15em 0.5em;
  border-radius: 4px;
  background: var(--brass-soft);
  color: var(--brass);
}

/* ==========================================================================
   Icon tile grid (infographic: kostenarten overview)
   ========================================================================== */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.6rem 0;
}
.tile {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.3rem 1.4rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.tile-icon {
  width: 38px; height: 38px;
  color: var(--stamp);
  margin-bottom: 0.7rem;
}
.tile-icon svg { width: 100%; height: 100%; }
.tile h4 { font-size: 1rem; margin-bottom: 0.3rem; }
.tile .tile-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--navy);
  font-size: 1.05rem;
  display: block;
  margin-bottom: 0.3rem;
}
.tile p { color: var(--ink-soft); font-size: 0.88rem; margin: 0; }

/* ==========================================================================
   Step strip (infographic: swap formula 3 steps — a genuine sequence)
   ========================================================================== */
.step-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 1.8rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-raised);
}
.step {
  padding: 1.4rem 1.3rem;
  border-right: 1px dashed var(--line);
  position: relative;
}
.step:last-child { border-right: none; }
.step-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--stamp);
  display: block;
  margin-bottom: 0.5rem;
}
.step p { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }
@media (max-width: 760px) {
  .step-strip { grid-template-columns: 1fr; }
  .step { border-right: none; border-bottom: 1px dashed var(--line); }
  .step:last-child { border-bottom: none; }
}

/* ==========================================================================
   Checklist
   ========================================================================== */
.checklist { list-style: none; padding: 0; margin: 1.2rem 0; display: grid; gap: 0.6rem; }
.checklist li {
  display: flex;
  gap: 0.7em;
  align-items: flex-start;
  font-size: 0.96rem;
  color: var(--ink-soft);
}
.checklist svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--ledger-green); margin-top: 0.1em; }

/* ==========================================================================
   Regulation stamp badges (trust infographic)
   ========================================================================== */
.stamp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.6rem 0;
}
.reg-stamp {
  border: 2px solid var(--stamp);
  border-radius: 50%;
  width: 108px;
  height: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--stamp);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transform: rotate(-4deg);
  flex-shrink: 0;
}
.reg-stamp:nth-child(2) { transform: rotate(3deg); }
.reg-stamp:nth-child(3) { transform: rotate(-2deg); }
.reg-stamp strong { display: block; font-size: 0.95rem; font-family: var(--font-display); text-transform: none; margin-bottom: 0.15em; }

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  cursor: pointer;
  padding: 1.1rem 0.2rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .plus { flex-shrink: 0; width: 22px; height: 22px; color: var(--stamp); transition: transform 0.2s var(--ease); }
.faq-item[open] summary .plus { transform: rotate(45deg); }
.faq-item p { padding: 0 0.2rem 1.1rem; color: var(--ink-soft); max-width: 42em; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--navy-deep);
  color: rgba(237,239,234,0.72);
  padding: 2.6rem 0 1.6rem;
  margin-top: 2rem;
  font-size: 0.88rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; } }
.footer-grid h5 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(237,239,234,0.5);
  margin: 0 0 0.8rem;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.footer-grid a { color: rgba(237,239,234,0.78); text-decoration: none; }
.footer-grid a:hover { color: var(--paper); }
.footer-legal {
  padding-top: 1.4rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.8rem;
  color: rgba(237,239,234,0.5);
}
.footer-disclaimer { max-width: 60em; color: rgba(237,239,234,0.55); font-size: 0.78rem; margin-top: 1rem; }

/* Utility */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.text-mono { font-family: var(--font-mono); }
