/* ── Reset & Variablen ── */
:root {
  --bg:      #0f1117;
  --surface: #1a1d27;
  --border:  #2a2d3a;
  --accent:  #f97316;
  --accent2: #fb923c;
  --text:    #e2e8f0;
  --muted:   #64748b;
  --success: #22c55e;
  --danger:  #ef4444;
  --radius:  16px;
}

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

html { font-size: 18px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration: none; }

/* ── Header ── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header .logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.header nav { display: flex; gap: 0.5rem; }

/* ── Seiteninhalt ── */
.page-wrap {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.4rem 5rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.page-sub {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 2.25rem;
  line-height: 1.6;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  margin-bottom: 1.4rem;
}
.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.1rem 2rem;
  border-radius: 14px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  min-height: 66px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: opacity 0.15s;
}
.btn:active { opacity: 0.75; }
.btn-primary  { background: var(--accent); color: #fff; }
.btn-outline  { background: transparent; border: 2px solid var(--border); color: var(--text); }
.btn-outline:hover, .btn-outline:active { border-color: var(--accent); color: var(--accent); }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-sm       { padding: 0.65rem 1.2rem; font-size: 0.95rem; min-height: 48px; }
.btn-full     { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Formulare ── */
.form-group { margin-bottom: 1.4rem; }
.form-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-control {
  width: 100%;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  padding: 1.1rem 1.25rem;
  font-size: 1.05rem;
  min-height: 66px;
  transition: border-color 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
}
select.form-control { cursor: pointer; }
select.form-control option { background: var(--surface); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}
@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ── Login ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.4rem;
}
.login-card {
  width: 100%;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
}
.login-logo {
  text-align: center;
  font-size: 4.5rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}
.login-sub {
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 2.75rem;
}

/* ── Upload-Zone ── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.drop-zone:active,
.drop-zone.dragover { border-color: var(--accent); background: rgba(249,115,22,.05); }
.drop-zone svg { color: var(--muted); margin-bottom: 1.25rem; display: block; margin-left: auto; margin-right: auto; }
.drop-zone p { color: var(--muted); font-size: 1rem; margin-bottom: 0.25rem; }
.drop-zone .tap-hint {
  display: inline-block;
  margin-top: 1.25rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 2rem;
  border-radius: 12px;
}

/* ── Method-Cards (Startseite) ── */
.method-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.15s;
}
.method-card:active { border-color: var(--accent); opacity: 0.85; }
.method-card:hover  { border-color: var(--accent); }
.method-card svg    { color: var(--accent); flex-shrink: 0; }
.method-card-title  { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.3rem; }
.method-card-sub    { color: var(--muted); font-size: 0.92rem; line-height: 1.45; }

/* ── Chat ── */
.chat-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
  -webkit-overflow-scrolling: touch;
}
.msg {
  max-width: 85%;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1.55;
}
.msg-agent  { background: var(--surface); border: 1px solid var(--border); align-self: flex-start; }
.msg-user   { background: var(--accent); color: #fff; align-self: flex-end; }
.msg-system { color: var(--muted); font-size: 0.85rem; text-align: center; align-self: center; }

.chat-input-row { display: flex; gap: 0.6rem; }
.chat-input-row .form-control { flex: 1; }

/* ── Warenkorb ── */
.cart-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.3rem 1.4rem;
  margin-bottom: 0.9rem;
}
.cart-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.cart-item-title { font-weight: 700; font-size: 1.05rem; }
.cart-item-meta  { color: var(--muted); font-size: 0.9rem; line-height: 1.7; }
.cart-item-price { font-size: 1.25rem; font-weight: 800; color: var(--accent); white-space: nowrap; }
.cart-item-actions { margin-top: 0.9rem; }

/* ── Analyse-Grid ── */
.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.analysis-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.analysis-item .label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.3rem; }
.analysis-item .value { font-weight: 800; font-size: 1.1rem; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
}
.badge-ok   { background: rgba(34,197,94,.15); color: var(--success); }
.badge-warn { background: rgba(249,115,22,.15); color: var(--accent); }

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  transition: transform 0.3s;
  z-index: 9999;
  white-space: nowrap;
  max-width: calc(100vw - 2.5rem);
}
#toast.show    { transform: translateX(-50%) translateY(0); }
#toast.error   { border-color: var(--danger); }
#toast.success { border-color: var(--success); }

/* ── Order Breakdown ── */
.breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  padding: 0.45rem 0;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.breakdown-row:last-child { border-bottom: none; }
.breakdown-row span:last-child { color: var(--text); font-weight: 600; }

/* ── Misc ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.75rem 0; }
.muted   { color: var(--muted); }
.price-total { font-size: 2rem; font-weight: 900; color: var(--accent); }

.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
