/* =========================================================================
   physio4me · Rezept-Upload
   Design-DNA aus physio4me.info (Montserrat oliv, Salbei, Pill-Buttons)
   Mobile-first, responsiv bis Desktop. Selbst-gehostete Fonts (DSGVO).
   IDs/Klassen wie app.js erwartet — reine Design-/Markup-Schicht.
   ========================================================================= */

@font-face {
  font-family: "Montserrat";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("/assets/fonts/montserrat-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("/assets/fonts/montserrat-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212;
}

:root {
  --olive:       #718355;
  --olive-deep:  #5C6B45;
  --sage:        #B5C99A;
  --sage-light:  #E9F5DB;
  --gold:        #A9824E;
  --ink:         #463939;
  --text:        #2C2C2C;
  --text-soft:   #6B6B6B;
  --cream:       #FBF9F4;
  --card:        #FFFFFF;
  --border:      #E6E2D9;
  --error:       #B5483A;
  --r-pill:      40px;
  --r-card:      22px;
  --r-img:       14px;
  --shadow-card: 0 12px 44px rgba(92,107,69,.10);
  --shadow-soft: 0 6px 20px rgba(92,107,69,.18);
  --maxw:        520px;
  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-weight: 600;
  color: var(--text);
  background: #FFFFFF;                 /* weiß wie die physio4me-Website */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Header: freistehendes Logo, zentriert (wie Website) ---------- */
.site-header {
  display: flex; justify-content: center;
  padding: 1.75rem 1rem 0.75rem;
}
.brand {
  height: 104px; width: auto; display: block;   /* Logo quadratisch (Läufer + Wortmarke) */
}

/* ---------- Layout ---------- */
#app {
  flex: 1; width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.5rem 1.1rem 2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 1.75rem 1.4rem;
  animation: rise 440ms cubic-bezier(.16,1,.3,1) both;
}
@keyframes rise { from { opacity:0; transform: translateY(14px) } to { opacity:1; transform:none } }

.state.hidden { display: none; }
#state-loading, #state-uploading { text-align: center; padding: 3rem 1.5rem; }
#state-success, #state-invalid, #state-error { text-align: center; }

h1 {
  font-weight: 700;
  font-size: clamp(1.55rem, 4.5vw, 2rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--olive);
  margin: 0 0 0.6rem;
}
#state-ready h1 span { color: var(--olive-deep); }

p { margin: 0.5rem 0; }
.lead {
  font-size: 1.05rem; font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 1.6rem;
}

/* ---------- Dropzone ---------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 1.5rem 1.25rem 1.4rem;
  border: 2px dashed var(--sage);
  border-radius: var(--r-img);
  background: linear-gradient(180deg, #fcfdfa 0%, var(--sage-light) 100%);
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
  cursor: pointer;
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--olive);
  outline: none;
}
.dropzone.dragover {
  border-color: var(--olive);
  background: var(--sage-light);
  transform: scale(1.01);
  box-shadow: var(--shadow-soft);
}
.dz-icon { width: 34px; height: 34px; color: var(--olive); margin-bottom: 0.15rem; }
.dz-title { margin: 0; font-weight: 700; font-size: 1.02rem; color: var(--olive-deep); }
.dz-or { margin: 0.1rem 0 0.35rem; font-size: 0.85rem; color: var(--text-soft); }

/* nur Mobile: Dropzone-Titel umformulieren via data */
@media (hover: none) and (pointer: coarse) {
  .dz-title { font-size: 1rem; }
}

/* ---------- Buttons ---------- */
button {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem 1.5rem;
  font-family: inherit; font-size: 1rem; font-weight: 700;
  letter-spacing: 0.01em;
  border: none; border-radius: var(--r-pill);
  cursor: pointer; min-height: 54px;
  transition: transform 120ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}
.dropzone button { width: auto; min-width: 200px; }

button.primary { background: var(--olive); color: #fff; box-shadow: var(--shadow-soft); }
button.primary:hover, button.primary:focus-visible { background: var(--olive-deep); transform: translateY(-1px); outline: none; }
button.primary:active { transform: translateY(0); }

button.secondary { background: var(--sage-light); color: var(--ink); }
button.secondary:hover, button.secondary:focus-visible { background: var(--sage); outline: none; }

button.with-icon { margin-top: 0.75rem; }
button svg { width: 20px; height: 20px; flex: none; }

/* ---------- Vorschau ---------- */
#preview img {
  width: 100%; height: auto; display: block;
  border-radius: var(--r-img);
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-card);
}
.actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.actions button { flex: 1 1 140px; }

/* ---------- Hinweise ---------- */
.hints {
  margin: 1.25rem 0 0; padding: 1rem 1.2rem;
  list-style: none;
  background: var(--sage-light);
  border-radius: var(--r-img);
  color: var(--olive-deep);
  font-size: 0.92rem; font-weight: 600;
}
.hints li { margin: 0.45rem 0; padding-left: 1.7rem; position: relative; }
.hints li::before { content: "✓"; position: absolute; left: 0; top: 0; font-weight: 700; color: var(--olive); }

/* ---------- Spinner ---------- */
.spinner { font-size: 1.08rem; color: var(--text-soft); display: inline-flex; align-items: center; gap: 0.65rem; }
.spinner::after {
  content: ""; width: 1.15em; height: 1.15em;
  border: 2.5px solid var(--sage); border-top-color: var(--olive);
  border-radius: 50%; display: inline-block; animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- Success ---------- */
.success-mark {
  width: 68px; height: 68px; margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--sage-light); color: var(--olive);
  border-radius: 50%;
  animation: pop 520ms cubic-bezier(.16,1,.3,1) 120ms both;
}
.success-mark svg { width: 34px; height: 34px; }
@keyframes pop { from { transform: scale(.4); opacity: 0 } to { transform: scale(1); opacity: 1 } }
#state-success h1 { color: var(--olive); }
#state-error h1 { color: var(--error); }

/* ---------- Links / Trust / Footer ---------- */
.phone a, .fallback a { color: var(--olive-deep); font-weight: 700; text-decoration: none; }
.phone a { font-size: 1.2rem; }
.phone a:hover, .fallback a:hover { text-decoration: underline; }
.fallback { margin-top: 1rem; color: var(--text-soft); font-size: 0.92rem; }

.trust {
  display: block; width: max-content; max-width: 100%;
  margin: 1rem auto 0; padding: 0.45rem 1.1rem;
  background: var(--sage-light); color: var(--olive-deep);
  border-radius: var(--r-pill); font-size: 0.85rem; font-weight: 600;
  text-align: center;
}

.site-footer {
  position: relative; z-index: 1;
  text-align: center; padding: 1.5rem 1rem 2rem;
  color: var(--text-soft); font-size: 0.8rem; opacity: 0.8;
}

/* ---------- Desktop ---------- */
@media (min-width: 600px) {
  .brand { height: 118px; }
  .card { padding: 2.25rem 2rem; }
  .dropzone { padding: 2rem 1.5rem 1.8rem; }
}

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