/* ========================================
   Bäckerei Wehner — Üchtelhausen Vorbestellung
   Matched to baeckereiwehner.de Design
   ======================================== */

:root {
  --cocoa: #3a2a1f;
  --cocoa-light: #4b3a2b;
  --gold: #C9A567;
  --gold-hover: #b8944e;
  --gold-light: #e8d5a8;
  --gold-glow: rgba(201, 165, 103, .12);
  --cream: #FFF9F1;
  --cream-dark: #f5ead8;
  --white: #ffffff;
  --text: #2b2117;
  --muted: #7a6f63;
  --border: #efe7dc;
  --border-focus: #C9A567;
  --shadow-sm: 0 2px 8px rgba(58, 42, 31, .06);
  --shadow-md: 0 8px 30px rgba(58, 42, 31, .1);
  --shadow-lg: 0 20px 60px rgba(58, 42, 31, .15);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --transition: .3s cubic-bezier(.4,0,.2,1);
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;
}

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ---- Layout ---- */
.wrap {
  max-width: 660px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

/* ---- Top Banner ---- */
.topbar {
  background: linear-gradient(135deg, var(--cocoa), var(--cocoa-light));
  color: rgba(255,255,255,.9);
  font-size: 13px;
  letter-spacing: .01em;
}
.topbar .inner {
  max-width: 660px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-icon { font-size: 15px; flex-shrink: 0; }
.topbar b { color: #fff; font-weight: 600; }

/* ---- Header ---- */
header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 0 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: var(--shadow-md);
  border: 2px solid rgba(255,255,255,.6);
}
.brand-logo-hidden { display: none; }
h1 {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0;
  line-height: 1.2;
  color: var(--cocoa);
}
.subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 400;
}

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 20px 24px;
  border: 1px solid var(--border);
}
.card-meta { margin-bottom: 14px; }

/* ---- Form Elements ---- */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  display: block;
  margin-bottom: 6px;
}
.pill {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gold-hover);
  background: var(--gold-glow);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  border: 1px solid rgba(201, 165, 103, .2);
  vertical-align: middle;
  margin-left: 4px;
}
input[type="text"],
input[type="tel"],
input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font: inherit;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
input::placeholder { color: #c4b9aa; }

/* ---- Buttons ---- */
button {
  font: inherit;
  background: var(--gold);
  color: var(--white);
  border: 0;
  border-radius: var(--radius-pill);
  padding: 12px 24px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .01em;
  box-shadow: 0 4px 16px rgba(201, 165, 103, .3);
  transition: background var(--transition), transform .15s ease, box-shadow var(--transition);
}
button:hover {
  background: var(--gold-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201, 165, 103, .4);
}
button:active { transform: translateY(0); }
button[disabled] {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}
.btn-lg {
  font-size: 16px;
  padding: 14px 32px;
  min-width: 240px;
}
.btn-send {
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  min-width: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-send svg { width: 18px; height: 18px; fill: currentColor; }

/* ---- Chat Container ---- */
.chat-wrap { position: relative; }
.chat {
  height: 440px;
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(180deg, var(--cream) 0%, var(--white) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  scroll-behavior: smooth;
}
.chat::-webkit-scrollbar { width: 5px; }
.chat::-webkit-scrollbar-track { background: transparent; }
.chat::-webkit-scrollbar-thumb { background: var(--cream-dark); border-radius: 3px; }
.chat::-webkit-scrollbar-thumb:hover { background: var(--border); }

/* ---- Messages ---- */
.msg {
  display: flex;
  margin: 8px 0;
  animation: msgIn .3s ease-out;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg .bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.5;
  word-break: break-word;
}
.me { justify-content: flex-end; }
.me .bubble {
  background: var(--cocoa);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(58, 42, 31, .15);
}
.bot .bubble {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

/* ---- Typing indicator ---- */
.typing { display: flex; gap: 4px; padding: 12px 16px; }
.typing span {
  width: 7px; height: 7px;
  background: var(--muted);
  border-radius: 50%;
  opacity: .4;
  animation: typing .8s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing {
  0%, 100% { opacity: .4; transform: translateY(0); }
  50% { opacity: .8; transform: translateY(-3px); }
}

/* ---- Input Area ---- */
.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.chat-input-row input { flex: 1; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ---- Status & Errors ---- */
.status { font-size: 12px; color: var(--muted); }
.error {
  color: #b91c1c;
  font-size: 13px;
  margin-top: 8px;
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
}

/* ---- Overlays ---- */
.start-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: rgba(255,249,241,.92);
  backdrop-filter: blur(6px) saturate(120%);
  z-index: 3;
}
.start-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 20px;
}
.start-card .brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
}
.start-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--cocoa);
}
.start-note {
  font-size: 13px;
  color: var(--muted);
  margin: -4px 0 4px;
}

/* Confirmation overlay */
.confirm-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: rgba(255,249,241,.95);
  backdrop-filter: blur(8px) saturate(120%);
  z-index: 5;
}
.confirm-card {
  max-width: 420px;
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 28px 24px;
  text-align: center;
}
.confirm-icon { font-size: 40px; margin-bottom: 8px; }
.confirm-card h3 {
  font-family: var(--font-heading);
  margin: 0 0 12px;
  font-size: 22px;
  color: var(--cocoa);
}
.confirm-card p { margin: 6px 0; font-size: 14px; color: var(--muted); }
.confirm-id {
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 13px;
  background: var(--gold-glow);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  display: inline-block;
  color: var(--cocoa);
  font-weight: 600;
  border: 1px solid rgba(201, 165, 103, .2);
}

.hidden { display: none !important; }

/* ---- Info Box ---- */
.info-box { margin-bottom: 12px; }
.info-title {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--cocoa);
  margin-bottom: 16px;
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.info-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--cream);
  border: 1px solid var(--border);
}
.info-item.highlight {
  background: var(--gold-glow);
  border-color: rgba(201, 165, 103, .25);
}
.info-icon { font-size: 22px; flex-shrink: 0; line-height: 1.3; }
.info-item strong {
  font-size: 14px;
  color: var(--cocoa);
  display: block;
  margin-bottom: 2px;
}
.info-item p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

/* ---- Legal Note ---- */
.legal-note {
  margin-top: 12px;
  padding: 14px 20px;
  background: var(--cream);
  border: 1px solid var(--border);
}
.legal-note p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
.legal-note a {
  color: var(--gold-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding: 16px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--cocoa); }

/* ---- Responsive ---- */
@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  .chat { height: 360px; padding: 12px; }
  .btn-lg { min-width: 200px; font-size: 15px; }
  .wrap { padding: 0 16px 32px; }
  .card { padding: 16px 18px; }
  .msg .bubble { max-width: 88%; }
}
