/*
 * followers.agency - the visual language of follower.kaufen ("Growth Console"), rebuilt for a
 * six-language, right-to-left-capable shop: one typeface, brand blue accent, definition from
 * hairlines instead of shadows, tabular figures for every number.
 *
 * Everything directional is expressed with logical properties (inline-start/end, margin-inline),
 * so the Arabic layout is the mirror image rather than a second stylesheet.
 */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f6f8;
  --surface-3: #eceef2;
  --ink: #0a0c10;
  --ink-muted: #59616d;
  --ink-faint: #98a0ac;
  --hairline: #ecedf1;
  --hairline-strong: #dde0e6;

  --accent: #005b9b;
  --accent-strong: #00497c;
  --accent-bright: #1a7ac0;
  --accent-soft: #e4eff7;

  --green: #3caa49;
  --green-soft: #e8f5ea;

  --dark: #0a1420;
  --dark-2: #101d2e;
  --dark-ink: #f2f5fa;
  --dark-muted: #98a6ba;
  --dark-hairline: rgba(255, 255, 255, 0.1);

  --danger: #e0483a;
  --danger-soft: #fcecea;
  --warning: #b06a10;
  --warning-soft: #fbf1de;

  --radius-sm: 7px;
  --radius: 11px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --container: 1180px;
  --gutter: clamp(1.15rem, 4vw, 2.5rem);

  --font: "Roboto", ui-sans-serif, system-ui, sans-serif;
  --tnum: "tnum" 1, "lnum" 1;
}

html[lang="ar"] {
  --font: "Cairo", "Roboto", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 900; }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.8rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }
main { flex: 1 0 auto; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.muted { color: var(--ink-muted); }
.num { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: var(--tnum); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}

.brand { display: inline-flex; align-items: center; }
.brand:hover { text-decoration: none; }
.logo { height: 30px; width: auto; display: block; }

/* Language menu: a flag button that opens the list. Each entry carries its own flag and its own
   name in its own script, so a reader recognises their language without reading ours. */

.lang-menu { position: relative; }

.lang-current {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}
.lang-current:hover { border-color: var(--accent-bright); color: var(--ink); }
.lang-current .chevron { width: 11px; height: 8px; transition: transform 0.15s ease; }
.lang-current[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.lang-current[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.flag {
  display: block;
  border-radius: 2px;
  flex: none;
  box-shadow: 0 0 0 1px rgba(10, 20, 32, 0.12);
}

.lang-list {
  position: absolute;
  top: calc(100% + 0.5rem);
  inset-inline-end: 0;
  z-index: 30;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  box-shadow: 0 18px 44px -12px rgba(10, 20, 32, 0.22);
}
.lang-list[hidden] { display: none; }

.lang-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.95rem;
  white-space: nowrap;
}
.lang-item:hover { background: var(--surface-2); text-decoration: none; }
.lang-item.is-active { color: var(--accent-strong); font-weight: 700; }
/* The ROW always follows the page direction, so flags and names line up in one column. Only the
   name itself is isolated, which lets Arabic run right-to-left inside its own box without turning
   the row around. */
.lang-item span {
  flex: 1 1 auto;
  unicode-bidi: isolate;
  text-align: start;
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(160deg, var(--dark) 0%, var(--dark-2) 100%);
  color: var(--dark-ink);
  padding-block: clamp(3rem, 8vw, 5.5rem);
}
.hero h1 { color: #fff; }
.hero p { color: var(--dark-muted); font-size: 1.05rem; }

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin-top: 1.6rem;
  padding: 0;
  list-style: none;
}
.hero-points li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--dark-ink);
  font-size: 0.92rem;
}
.hero-points li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

/* ---------- Sections + cards ---------- */

.section { padding-block: clamp(2.2rem, 5vw, 3.4rem); }
.section + .section { border-top: 1px solid var(--hairline); }

.section-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.4rem;
}
.section-head svg {
  width: 26px;
  height: 26px;
  fill: var(--accent);
  flex: none;
}
.section-head h2 { margin: 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 0.9rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
a.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.card h3 { margin: 0; }
.card .price { color: var(--accent); font-weight: 700; }
.card .origins { color: var(--ink-faint); font-size: 0.85rem; }

/* ---------- Order form ---------- */

.order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  gap: 1.6rem;
  align-items: start;
}
@media (max-width: 860px) {
  .order-layout { grid-template-columns: 1fr; }
}

.panel {
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 1.4rem;
}
.panel + .panel { margin-top: 1rem; }

.field { margin-bottom: 1.2rem; }
.field:last-child { margin-bottom: 0; }
.field > label,
.field > .label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.45rem;
}
.hint { color: var(--ink-muted); font-size: 0.85rem; margin: 0.35rem 0 0; }

input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="password"] {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  color: inherit;
  background: var(--surface);
}
input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

.seg { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.seg button {
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font: inherit;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
}
.seg button:hover { border-color: var(--accent-bright); color: var(--ink); }
.seg button[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
  font-weight: 700;
}

.qty-row { display: flex; gap: 0.6rem; align-items: center; }
.qty-row input { max-width: 190px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { background: var(--accent-strong); color: #fff; text-decoration: none; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--hairline-strong);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--accent-strong); }
.btn-block { width: 100%; }

/* ---------- Summary ---------- */

.summary { position: sticky; top: 88px; }
.summary dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.45rem 1rem; }
.summary dt { color: var(--ink-muted); font-size: 0.9rem; }
.summary dd { margin: 0; text-align: end; font-weight: 500; overflow-wrap: anywhere; }
.summary .total {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.summary .total strong { font-size: 1.5rem; color: var(--accent); }

.notice {
  border: 1px solid var(--hairline-strong);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
}
.notice.ok { border-inline-start-color: var(--green); background: var(--green-soft); }
.notice.warn { border-inline-start-color: var(--warning); background: var(--warning-soft); }
.notice.bad { border-inline-start-color: var(--danger); background: var(--danger-soft); }

/* ---------- Status + steps ---------- */

.steps { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; gap: 0.7rem; }
.steps li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.steps .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink-faint);
  margin-top: 0.45rem;
  flex: none;
}
.steps li.done .dot { background: var(--green); }
.steps li.active .dot { background: var(--accent); }
.steps strong { display: block; }
.steps span { color: var(--ink-muted); font-size: 0.9rem; }

/* Latin data inside an Arabic sentence - a link, an order number, an address. Without isolation
   the bidi algorithm pulls their punctuation and digits to the wrong edge. */
.ltr {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  text-align: left;
}
.logo { direction: ltr; }

/* ---------- Thank-you page ---------- */

.thanks-mark {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--green-soft);
  display: grid; place-items: center;
  margin-bottom: 1.1rem;
}
.thanks-mark svg { width: 30px; height: 30px; fill: var(--green); }

.lead { font-size: 1.1rem; color: var(--ink-muted); }

.receipt { margin-block: 1.4rem; }
.receipt dl { margin: 0; display: grid; gap: 0.9rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.receipt dt { font-size: 0.8rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.receipt dd { margin: 0.2rem 0 0; font-weight: 500; }

/* ---------- Tables (admin) ---------- */

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.data th,
table.data td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--hairline);
  text-align: start;
  white-space: nowrap;
}
table.data th { color: var(--ink-muted); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
table.data tr:hover td { background: var(--surface-2); }

.tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--ink-muted);
}
.tag.ok { background: var(--green-soft); color: #26702f; }
.tag.bad { background: var(--danger-soft); color: #9c2b20; }
.tag.warn { background: var(--warning-soft); color: var(--warning); }

.stat-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 1.2rem; }
.stat {
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  padding: 0.8rem 1.1rem;
  min-width: 150px;
}
.stat span { display: block; color: var(--ink-muted); font-size: 0.8rem; }
.stat strong { font-size: 1.4rem; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 3rem;
  background: var(--dark);
  color: var(--dark-muted);
  padding-block: 2.2rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
}
.site-footer strong { color: var(--dark-ink); }
.site-footer a { color: var(--dark-ink); }
.footer-links { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; }
.footer-brand p, .footer-meta p { margin: 0.3rem 0 0; font-size: 0.88rem; }
.footer-meta .muted { color: var(--dark-muted); }

/* ---------- Utility ---------- */

/* Innerhalb des Containers gibt es keine zweite, engere Spalte: Textseiten wie Impressum und
   Datenschutz laufen genauso breit wie alles andere. */
.prose { max-width: none; }
.prose h2 { margin-top: 1.8rem; }
.stack > * + * { margin-top: 1rem; }
.center { text-align: center; }
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 1.4rem auto;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 3s; }
  a.card:hover { transform: none; }
}
