/* =====================================================================
   Partnertag, gemeinsame Basis
   Farben und Schrift zentral hier anpassen, dann greift es auf allen
   drei Seiten (Formular, Anzeige, Admin).
   ===================================================================== */

@font-face {
  font-family: "GT Eesti";
  src: url("/assets/fonts/GT-Eesti-Pro-Display-Light.woff2") format("woff2");
  font-weight: 100 400;
  font-display: swap;
}
@font-face {
  font-family: "GT Eesti";
  src: url("/assets/fonts/GT-Eesti-Pro-Display-Medium.woff2") format("woff2");
  font-weight: 500 900;
  font-display: swap;
}

:root {
  --brand:        #14304f;
  --brand-soft:   #1f4671;
  --kyocera-red:  #DB0D23;
  --accent:       #0aa06e;
  --accent-warn:  #e0902a;
  --accent-low:   #d64545;

  --ink:          #10202f;
  --ink-soft:     #5a6b7b;
  --line:         #dde4ea;
  --bg:           #f2f5f8;
  --card:         #ffffff;

  --radius:       14px;
  --radius-lg:    22px;
  --shadow:       0 1px 2px rgba(16, 32, 47, .06), 0 8px 28px rgba(16, 32, 47, .08);
  --font: "GT Eesti", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-synthesis: none;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }

a { color: var(--brand-soft); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Formularseite ---------- */

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 18px calc(40px + env(safe-area-inset-bottom));
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 18px;
}

.masthead__brand {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
}

.masthead__mark {
  min-width: 38px; height: 38px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--kyocera-red);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 15px;
  letter-spacing: .04em;
  white-space: nowrap;
  flex: none;
}

.masthead__mark[hidden] { display: none; }

.masthead__logo {
  height: 26px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
  flex: none;
}
.masthead__logo[hidden] { display: none; }

.masthead__text { font-weight: 600; font-size: 15px; }
.masthead__sub  { display: block; font-weight: 400; font-size: 13px; color: var(--ink-soft); }

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  margin-bottom: 16px;
}

.product { text-align: center; }

.product__media {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(45deg, #eef2f6 0 12px, #e7edf3 12px 24px);
  display: grid; place-items: center;
  color: var(--ink-soft);
  font-size: 13px;
  margin-bottom: 16px;
  overflow: hidden;
}

.product__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product h1 { font-size: 24px; }
.product p  { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* Restbestand als Streifen ueber dem Formular */

.stockbar { margin-top: 18px; }

.stockbar__head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 14px; margin-bottom: 6px;
}
.stockbar__count { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.stockbar__label { color: var(--ink-soft); }

.stockbar__track {
  height: 10px; border-radius: 99px;
  background: #e4eaf0; overflow: hidden;
}
.stockbar__fill {
  height: 100%; width: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width .6s cubic-bezier(.4, 0, .2, 1), background-color .6s ease;
}
.stockbar__fill.is-warn { background: var(--accent-warn); }
.stockbar__fill.is-low  { background: var(--accent-low); }

/* Formularfelder */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 14px; font-weight: 600;
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="number"] {
  width: 100%;
  font: inherit;
  font-size: 16px;               /* verhindert Zoom beim Fokus auf iOS */
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(31, 70, 113, .14);
}

.field input[aria-invalid="true"] { border-color: var(--accent-low); }

.field__error {
  display: none;
  font-size: 13px; color: var(--accent-low);
  margin-top: 5px;
}
.field.has-error .field__error { display: block; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .row { grid-template-columns: 1fr; gap: 0; } }

/* Stueckzahl mit Plus und Minus, gut mit dem Daumen bedienbar */

.stepper { display: flex; align-items: stretch; gap: 8px; max-width: 220px; }

.stepper button {
  flex: none;
  width: 50px;
  font-size: 22px; font-weight: 500;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff; color: var(--brand);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.stepper button:active { background: #eef2f6; }
.stepper button:disabled { opacity: .4; cursor: not-allowed; }
.stepper input { text-align: center; font-weight: 700; }

/* Datenschutz-Checkbox */

/* Spezifitaet muss ueber '.field label' liegen, sonst greift dort
   display: block und die Checkbox rutscht ueber den Text. */
.field label.consent {
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 14px;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fafcfd;
}
.field label.consent input {
  width: 22px; height: 22px;
  flex: none; margin: 1px 0 0;
  accent-color: var(--brand);
}
.field label.consent.has-error { border-color: var(--accent-low); }

.btn {
  display: block; width: 100%;
  font: inherit; font-size: 17px; font-weight: 600;
  padding: 16px;
  border: 0; border-radius: var(--radius);
  background: var(--brand); color: #fff;
  cursor: pointer;
  transition: background-color .15s ease, transform .08s ease;
}
.btn:hover:not(:disabled) { background: var(--brand-soft); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { background: #9fb0c0; cursor: not-allowed; }

.btn--ghost {
  background: transparent; color: var(--brand);
  border: 1.5px solid var(--line);
}
.btn--ghost:hover:not(:disabled) { background: #eef2f6; color: var(--brand); }

.notice {
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
}
.notice--error { background: #fdecec; color: #8f2626; }
.notice--info  { background: #eaf3fb; color: #1b4670; }

.foot {
  text-align: center;
  font-size: 13px; color: var(--ink-soft);
  padding-top: 8px;
}
.foot a { color: var(--ink-soft); }

/* Bestaetigung nach dem Absenden */

.done { text-align: center; padding: 34px 20px; }
.done__mark {
  width: 68px; height: 68px; margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-size: 34px;
  animation: pop .45s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.done h2 { font-size: 22px; }
.done p  { color: var(--ink-soft); margin: 0 0 20px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
