/* ==========================================================================
   Schulbuchbörse — Design System
   Palette: Tannengrün / Papier-Creme / Bernstein. Keine externen Fonts (DSGVO).
   ========================================================================== */

:root {
  --green-900: #123528;
  --green-800: #17452f;
  --green-700: #1e5c46;
  --green-600: #2a7458;
  --green-100: #e3efe7;
  --green-50:  #f0f6f1;
  --amber-500: #e0a437;
  --amber-600: #c78a1f;
  --amber-100: #faeed3;
  --paper:     #faf7f1;
  --paper-dark:#f3eee3;
  --white:     #ffffff;
  --ink:       #22302a;
  --muted:     #64716a;
  --border:    #e2ddd2;
  --danger:    #b3372f;
  --danger-dark:#93271f;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(24, 45, 36, 0.08);
  --shadow-md: 0 6px 24px rgba(24, 45, 36, 0.10);
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
img { max-width: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16.5px;
}

h1, h2, h3 { font-family: var(--font-serif); font-weight: 700; color: var(--green-900); line-height: 1.2; }
h1 { font-size: 2.1rem; margin: 0.4em 0 0.5em; }
h2 { font-size: 1.5rem; margin: 2.2rem 0 0.8rem; }
h3 { font-size: 1.12rem; margin: 0 0 0.4rem; }
a { color: var(--green-700); }
a:hover { color: var(--green-600); }
hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1040px; margin: 0 auto; padding: 0.65rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand-logo { height: 46px; width: auto; flex-shrink: 0; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--green-700); color: var(--white);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text {
  font-family: var(--font-serif); font-weight: 700; font-size: 1.28rem;
  color: var(--green-900); letter-spacing: -0.01em;
}
.brand-text em { font-style: normal; color: var(--green-700); }
.brand-sub { display: block; font-family: var(--font-sans); font-size: 0.68rem; font-weight: 500; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-top: -3px; }

.site-nav { display: flex; align-items: center; gap: 1.35rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.98rem; }
.site-nav a:hover { color: var(--green-700); }
.site-nav .button { font-weight: 600; }
.nav-user { color: var(--muted); font-size: 0.9rem; }
button.linklike {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 0.95rem; padding: 0; font-family: var(--font-sans);
}
button.linklike:hover { color: var(--green-700); text-decoration: underline; }
form.inline { display: inline; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.button {
  display: inline-block;
  background: var(--green-700);
  color: var(--white) !important;
  border: 1.5px solid var(--green-700);
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.button:hover { background: var(--green-800); border-color: var(--green-800); }
.button:active { transform: translateY(1px); }
.button.secondary { background: transparent; color: var(--green-700) !important; }
.button.secondary:hover { background: var(--green-50); }
.button.accent { background: var(--amber-500); border-color: var(--amber-500); color: var(--green-900) !important; }
.button.accent:hover { background: var(--amber-600); border-color: var(--amber-600); }
.button.small { padding: 0.35rem 0.95rem; font-size: 0.9rem; }
.button.danger { background: var(--danger); border-color: var(--danger); }
.button.danger:hover { background: var(--danger-dark); border-color: var(--danger-dark); }

/* --------------------------------------------------------------------------
   Flash-Meldungen
   -------------------------------------------------------------------------- */
.flash { padding: 0.7rem 1.1rem; border-radius: var(--radius-sm); margin: 0.9rem 0; border: 1px solid; font-size: 0.97rem; }
.flash.info    { background: #eef4fb; border-color: #c4d8ee; color: #274a6d; }
.flash.success { background: var(--green-100); border-color: #b7d8c2; color: var(--green-800); }
.flash.error   { background: #fbeceb; border-color: #efc4c0; color: var(--danger-dark); }

/* --------------------------------------------------------------------------
   Landingpage
   -------------------------------------------------------------------------- */
.hero {
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-dark) 100%);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 0 3rem;
}
.hero-grid {
  max-width: 1040px; margin: 0 auto; padding: 0 1.25rem;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 3rem; align-items: center;
}
.eyebrow {
  display: inline-block; background: var(--green-100); color: var(--green-800);
  border: 1px solid #c9dfd0; border-radius: 999px; padding: 0.25rem 0.9rem;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.03em; margin-bottom: 1.1rem;
}
.hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 3rem);
  margin: 0 0 1rem;
  letter-spacing: -0.015em;
}
.hero h1 .accent { color: var(--green-700); font-style: italic; }
.hero .lead { font-size: 1.16rem; color: #46534c; max-width: 34em; margin: 0 0 1.6rem; }
.cta { display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: center; }
.hero-art { display: flex; justify-content: center; }
.hero-art svg { width: 100%; max-width: 380px; height: auto; }

.stats-band { background: var(--green-800); color: var(--white); }
.stats-inner {
  max-width: 1040px; margin: 0 auto; padding: 1.4rem 1.25rem;
  display: flex; justify-content: space-around; gap: 1.5rem; flex-wrap: wrap; text-align: center;
}
.stat-number { font-family: var(--font-serif); font-size: 2rem; font-weight: 700; display: block; color: var(--amber-500); line-height: 1.1; }
.stat-label { font-size: 0.92rem; opacity: 0.9; }

.section { padding: 3.2rem 0 1rem; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 2.2rem; }
.section-head h2 { font-size: 1.9rem; margin: 0 0 0.5rem; }
.section-head p { color: var(--muted); margin: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.step {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem 1.5rem; box-shadow: var(--shadow-sm); position: relative;
}
.step-num {
  font-family: var(--font-serif); font-size: 2.6rem; font-weight: 700;
  color: var(--amber-500); line-height: 1; display: block; margin-bottom: 0.6rem;
}
.step h3 { font-size: 1.15rem; }
.step p { margin: 0; color: #4a564f; font-size: 0.97rem; }

.audience { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.audience-card {
  border-radius: var(--radius); padding: 1.8rem 1.7rem;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.audience-card.sell { background: var(--green-50); }
.audience-card.buy  { background: var(--amber-100); }
.audience-card h3 { font-size: 1.3rem; margin-bottom: 0.6rem; }
.audience-card ul { margin: 0 0 1.2rem; padding-left: 1.2rem; }
.audience-card li { margin-bottom: 0.35rem; }

.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.trust-item { text-align: center; padding: 0.5rem 1rem; }
.trust-icon {
  width: 52px; height: 52px; margin: 0 auto 0.8rem; border-radius: 50%;
  background: var(--green-100); color: var(--green-700);
  display: flex; align-items: center; justify-content: center;
}
.trust-icon svg { width: 26px; height: 26px; }
.trust-item h3 { font-size: 1.05rem; }
.trust-item p { margin: 0; color: var(--muted); font-size: 0.94rem; }

.faq { max-width: 720px; margin: 0 auto; }
.faq details {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.9rem 1.2rem; margin-bottom: 0.7rem;
}
.faq summary { cursor: pointer; font-weight: 600; color: var(--green-900); }
.faq details[open] summary { margin-bottom: 0.5rem; }
.faq details p { margin: 0; color: #4a564f; }

.cta-band {
  background: var(--green-800); border-radius: var(--radius);
  padding: 2.6rem 2rem; text-align: center; margin: 3rem 0;
}
.cta-band h2 { color: var(--white); margin: 0 0 0.5rem; font-size: 1.7rem; }
.cta-band p { color: #cfe0d5; margin: 0 0 1.4rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.chip {
  background: var(--white); border: 1.5px solid var(--green-700); color: var(--green-700);
  border-radius: 999px; padding: 0.3rem 1.05rem; text-decoration: none; font-weight: 600; font-size: 0.95rem;
  transition: background 0.15s ease;
}
.chip:hover { background: var(--green-700); color: var(--white); }

/* --------------------------------------------------------------------------
   Inhaltsseiten: Karten, Tabellen, Formulare
   -------------------------------------------------------------------------- */
main > .container { padding-top: 0.6rem; padding-bottom: 2.5rem; }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin: 1.2rem 0;
  max-width: 680px;
}
.card label { display: block; margin: 0.8rem 0 0.25rem; font-weight: 600; font-size: 0.95rem; }
.card label.checkbox, .card label.radio { font-weight: 400; margin: 0.5rem 0; }
.card input[type="text"], .card input[type="email"], .card textarea, .card select {
  width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 1rem; font-family: var(--font-sans); background: var(--paper);
}
.card input:focus, .card textarea:focus, .card select:focus {
  outline: 2px solid var(--green-600); outline-offset: 0; border-color: var(--green-600); background: var(--white);
}
.card button { margin-top: 1.1rem; }

table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); margin: 1rem 0;
}
th, td { text-align: left; padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
th {
  background: var(--green-50); color: var(--green-900);
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em;
}
tr.inactive { opacity: 0.45; }
td.actions form { display: inline-block; margin: 0 0.2rem 0.2rem 0; }

.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; }
.badge {
  background: var(--green-700); color: var(--white); border-radius: 999px;
  padding: 0.12rem 0.6rem; font-size: 0.85rem; font-weight: 600;
}
.status { padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.84rem; font-weight: 600; }
.status.offen      { background: var(--green-100); color: var(--green-800); }
.status.reserviert { background: var(--amber-100); color: #8a6011; }
.status.verkauft   { background: #e8e6e0; color: var(--muted); }

.filter { margin: 1.2rem 0; display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.filter select {
  padding: 0.5rem 0.7rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-size: 1rem; background: var(--white); font-family: var(--font-sans);
}

.offer-form h3 small { color: var(--muted); font-weight: 400; font-family: var(--font-sans); font-size: 0.82rem; }
.offer-form .hint { color: var(--muted); font-size: 0.9rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: flex-end; }
.inline-form label { display: flex; flex-direction: column; font-size: 0.88rem; gap: 0.2rem; font-weight: 600; }
.inline-form input, .inline-form select {
  padding: 0.5rem 0.65rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 1rem; background: var(--paper); font-family: var(--font-sans);
}
.inline-form input:focus, .inline-form select:focus { outline: 2px solid var(--green-600); background: var(--white); }
.inline-form .button { margin: 0; }

.meta { color: var(--muted); }
textarea[hidden] { display: none; }
details summary { cursor: pointer; font-weight: 600; }

/* Adminportal */
.admin-tabs {
  display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.2rem 0 1.4rem;
  border-bottom: 1px solid var(--border); padding-bottom: 0.8rem;
}
.admin-tabs a {
  padding: 0.35rem 1rem; border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: 0.95rem; color: var(--green-800);
  border: 1.5px solid transparent;
}
.admin-tabs a:hover { background: var(--green-50); }
.admin-tabs a.active { background: var(--green-700); color: var(--white); }

.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.9rem; margin: 0 0 1.5rem;
}
.stat-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.9rem 1rem; text-align: center; box-shadow: var(--shadow-sm);
}
.stat-value {
  display: block; font-family: var(--font-serif); font-weight: 700;
  font-size: 1.6rem; color: var(--green-800); line-height: 1.2;
}
.stat-name { font-size: 0.85rem; color: var(--muted); }

/* Buchcover */
.cover-thumb {
  width: 44px; min-width: 44px; height: 60px; object-fit: cover; border-radius: 4px;
  border: 1px solid var(--border); background: var(--green-50); display: block;
}
.cover-cell { width: 52px; }
.cover-lg {
  width: 130px; height: 178px; object-fit: cover; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--green-50);
  box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.detail-head { display: flex; gap: 1.6rem; align-items: flex-start; margin: 1rem 0 0.5rem; }
.detail-head h1 { margin-top: 0; }
.offer-head { display: flex; gap: 0.9rem; align-items: flex-start; }
.offer-head h3 { margin-top: 0; }

.demand { color: #8a6011; font-size: 0.85rem; font-weight: 600; }

/* Verkaufen-Tabelle (alle Bücher einer Klasse auf einmal anbieten) */
.sell-table td { vertical-align: middle; }
.sell-table .sell-check { width: 34px; text-align: center; }
.sell-table input[type="checkbox"], .sell-actions input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--green-700);
}
.sell-table input[type="text"], .sell-table select {
  padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.95rem; background: var(--paper); font-family: var(--font-sans);
}
.sell-table input[name^="price_"] { width: 5.5em; }
.sell-table input[name^="comment_"] { width: 100%; min-width: 10em; }
.sell-table input:focus, .sell-table select:focus { outline: 2px solid var(--green-600); background: var(--white); }
.sell-actions {
  display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap;
  margin: 1.2rem 0 0.5rem;
}
@media (max-width: 560px) {
  .detail-head { flex-direction: column; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--green-900); color: #b9cec1; margin-top: 3rem; }
.footer-grid {
  max-width: 1040px; margin: 0 auto; padding: 2.6rem 1.25rem 1.2rem;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem;
}
.site-footer h4 { color: var(--white); font-family: var(--font-serif); font-size: 1.05rem; margin: 0 0 0.7rem; }
.site-footer p { margin: 0; font-size: 0.92rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.45rem; }
.site-footer a { color: #b9cec1; text-decoration: none; font-size: 0.95rem; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-bottom {
  max-width: 1040px; margin: 0 auto; padding: 1rem 1.25rem 1.6rem;
  border-top: 1px solid rgba(255,255,255,0.12); font-size: 0.85rem; color: #8fa89a;
}
.footer-brand { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.7rem; }
.footer-brand .brand-mark { background: var(--green-700); width: 34px; height: 34px; border-radius: 8px; }
.footer-brand .brand-mark svg { width: 20px; height: 20px; }
.footer-brand span { font-family: var(--font-serif); font-weight: 700; color: var(--white); font-size: 1.1rem; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .hero { padding: 2.4rem 0 2.2rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .hero-art { order: -1; }
  .hero-art svg { max-width: 240px; }
  .steps, .trust { grid-template-columns: 1fr; }
  .audience { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  table { display: block; overflow-x: auto; }
}
@media (max-width: 560px) {
  .header-inner { justify-content: center; }
  .site-nav { justify-content: center; gap: 0.9rem; }
  h1 { font-size: 1.7rem; }
}
