/* Assemblage – light theme aligned with landing page; with micro-animations & modern inputs */

:root{
  --primary: #0F2743;
  --primary-ink: #ffffff;

  --page: #F3F6F8;
  --card: #FFFFFF;
  --border: #E6EDF2;

  --text: #243447;
  --muted: #6A7A89;

  --accent-cream: #EADFBB;
  --accent-pink:  #F6C6CF;
  --accent-green: #9AC3A5;

  --danger-bg: #FFE9EA;
  --danger-ink: #7A0C14;
  --focus-ring: rgba(15,39,67,.16);

  --radius: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 6px 18px rgba(15,39,67,.06);
  --shadow-md: 0 10px 28px rgba(15,39,67,.08);
  --ease: cubic-bezier(.22,.61,.36,1);

  --font-display: roca, "Roca", "Roca One", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";

  /* New tokens for animated hover pill */
  --pill-bg: #E8FBF0;         /* light green */
  --pill-border: #C8F0D7;
  --pill-ink: #236B3E;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
@media (prefers-reduced-motion: reduce){
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body.bg {
  margin: 0;
  color: var(--text);
  background: linear-gradient(0deg, rgba(234,223,187,.18), transparent 35%) , var(--page);
  font-family: var(--font-body);
}

/* >>> Force hero background on login page <<< */
body.bg.login-hero {
  background: #0F2643 !important;  /* brand dark */
  background-image: none !important;
  color: #ffffff;
}

.shell { max-width: 1100px; margin: 0 auto; padding: 24px; }
.center { text-align: center; }
.tiny { font-size: 12px; }
.muted { color: var(--muted); }
.is-hidden { display: none !important; } /* utility */

/* Brand */
.brand { display: flex; align-items: center; gap: 12px; justify-content: center; }
.brand.small { justify-content: flex-start; }
.brand-logo { display: block; height: 22px; width: auto; border-radius: 4px; }

.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: conic-gradient(from 210deg, var(--accent-cream) 0 33%, var(--accent-green) 33% 66%, var(--accent-pink) 66% 100%);
  box-shadow: inset 0 0 0 1px rgba(15,39,67,.18);
}

/* Headings in ROCA */
h1, h2, h3 {
  margin: 0 0 10px 0;
  letter-spacing: .2px;
  color: var(--primary);
  font-family: var(--font-display);
}

p { margin: 0 0 10px 0; }

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 16px; margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--primary);
  color: var(--primary-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.topbar .brand span { color: var(--primary-ink); font-weight: 600; font-family: var(--font-display); }
.topbar .brand .brand-mark { box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); }
.topbar .link { color: #EAF2FF; border-color: transparent; }
.topbar .btn.ghost { background: transparent; color: var(--primary-ink); border-color: rgba(255,255,255,.32); }
.topbar .btn.ghost:hover { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.5); }
.topbar .btn.ghost:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.spacer { flex: 1; }

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .26s var(--ease), box-shadow .26s var(--ease);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.elevate { box-shadow: var(--shadow-md); }

/* Appear animation helper */
.appears { opacity: 0; transform: translateY(8px); }
.appears.is-in { opacity: 1; transform: translateY(0); transition: opacity .5s var(--ease), transform .5s var(--ease); }

/* Layout */
.stack { display: flex; flex-direction: column; }
.gap { gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Inputs */
.field.fancy { position: relative; }
.field.fancy input {
  width: 100%; border: 1px solid var(--border); background: #FAFCFE;
  color: var(--text); padding: 14px 12px 12px; border-radius: var(--radius-sm); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field.fancy input:focus { border-color: #B8C8D8; box-shadow: 0 0 0 6px var(--focus-ring); }
.field.fancy label {
  position: absolute; left: 12px; top: 10px; color: var(--muted); font-size: 13px; pointer-events: none;
  transition: transform .18s var(--ease), font-size .18s var(--ease), color .18s; background: transparent;
}
.field.fancy input:focus + label, .field.fancy input:not(:placeholder-shown) + label { transform: translateY(-12px); font-size: 11px; color: var(--primary); }

/* Buttons (ROCA) */
.btn {
  border: 1px solid var(--border);
  background: #F8FBFF;
  color: var(--primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform .04s ease, background .2s ease, border .2s ease, box-shadow .2s ease;
  font-family: var(--font-display);
  letter-spacing: .2px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); box-shadow: 0 6px 16px rgba(15,39,67,.18); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary:active { filter: brightness(0.98); }
.btn.ghost { background: #FFFFFF; color: var(--primary); }
.btn.danger { background: var(--danger-bg); color: var(--danger-ink); border-color: #F7C6C9; }

.link { color: var(--primary); text-decoration: none; border-bottom: 1px dashed transparent; }
.link:hover { border-bottom-color: var(--primary); }
.link.subtle { color: #ffffff; opacity: .9; }
.link.subtle:hover { opacity: 1; border-bottom-color: rgba(255,255,255,.6); }

.error { color: #B5131C; }

/* ===================================================== */
/* ===== Minimalist Login (full-bleed hero look) ======= */
/* ===================================================== */

.login-hero { display: grid; place-items: center; padding: 0 16px; }

.login-shell {
  width: 100%;
  max-width: 760px;
  text-align: center;
  display: grid;
  gap: 22px;
}

.login-logo { height: 64px; width: auto; margin: 0 auto 6px; filter: drop-shadow(0 2px 8px rgba(0,0,0,.08)); }

.login-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: #ffffff;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.18;
  letter-spacing: .2px;
  margin: 0 auto 8px;
  max-width: 22ch;
}

/* Inline login bar */
.login-bar {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0;
  margin: 0 auto;
  max-width: 720px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(4px);
}
.login-bar input {
  appearance: none;
  border: 0;
  padding: 14px 14px;
  font-size: 16px;
  color: #ffffff;
  background: transparent;
}
.login-bar input::placeholder { color: rgba(255,255,255,.8); }
.login-bar input:focus { outline: none; background: rgba(255,255,255,.06); }
.login-bar input + input { border-left: 1px solid rgba(255,255,255,.25); }

/* WHITE login button with brand text */
.login-btn {
  border: 0;
  border-left: 1px solid rgba(255,255,255,.25);
  height: 100%;
  border-radius: 0;
  padding: 0 18px;
  background: #ffffff;
  color: #0F2643; /* brand dark */
  font-weight: 700;
  box-shadow: none;
}
.login-btn:hover { filter: none; background: #ffffff; }
.login-btn:active { background: #F2F2F2; }

.login-error {
  margin: 4px auto 0;
  max-width: 720px;
  background: rgba(255, 233, 234, .98);
  color: #7A0C14;
  padding: 8px 12px;
  border-radius: 10px;
}
.login-secondary { margin-top: 2px; font-size: 14px; color: rgba(255,255,255,.9); }

@media (max-width: 560px) {
  .login-bar {
    grid-template-columns: 1fr;
    gap: 1px;
  }
  .login-bar input + input {
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,.25);
  }
  .login-btn {
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,.25);
    height: auto;
    padding-block: 8px;
    padding-inline: 18px;
  }
}

/* ===================================================== */
/* ====== Order & Admin shared components ============== */
/* ===================================================== */

.line {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: #FBFDFE;
}
.line label { font-weight: 700; color: var(--text); }

/* Product image thumbnail */
.prod-img {
  width: 56px; height: 56px;
  border-radius: 12px; object-fit: cover;
  background: #F5F7FA; box-shadow: inset 0 0 0 1px rgba(15,39,67,.10);
}

.icon.placeholder { width: 56px; height: 56px; border-radius: 12px; background: var(--accent-cream); }
.icon.placeholder.pasta { background: var(--accent-pink); }
.icon.placeholder.garlic { background: var(--accent-green); }
.icon.placeholder.egg { background: #E4E9F1; }

/* Quantity stepper */
.stepper {
  display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px;
  overflow: hidden; background: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(15,39,67,.02);
}
.stepper .step {
  appearance: none; border: none; background: transparent; color: var(--primary);
  width: 40px; height: 36px; font-size: 18px; line-height: 1; cursor: pointer; transition: background .15s;
}
.stepper .step:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--focus-ring); }
.stepper .step:hover { background: #F3F7FC; }
.stepper input { width: 64px; text-align: center; border: none; background: transparent; color: var(--text);
  font-weight: 700; font-feature-settings: "tnum"; padding: 0 8px; }
.stepper input:focus { outline: none; }

/* Actions / summary */
.actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.actions.wrap { flex-wrap: wrap; }

/* ===== Enhanced Order Summary ===== */
.summary-card { padding-bottom: 68px; position: relative; }
.summary-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.pill { background: #F1F5FA; border: 1px solid var(--border); color: var(--primary);
  padding: 6px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; font-family: var(--font-display); }
.summary-table-wrap { margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #FFF; }
.summary-table { width: 100%; border-collapse: collapse; }
.summary-table thead th { background: #F6FAFF; color: var(--muted); font-weight: 700; font-size: 13px; letter-spacing: .2px; border-bottom: 1px solid var(--border); padding: 10px 12px; }
.summary-table td {
  padding: 12px 12px 12px 20px;
  border-bottom: 1px solid var(--border);
}
.summary-table tr:last-child td { border-bottom: none; }
.right { text-align: right; }
.prod { display: flex; flex-direction: column; }
.prod-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.prod-unit { font-size: 12px; color: var(--muted); }
.summary-table tfoot .label { font-weight: 700; color: var(--primary); }
.summary-table tfoot tr.tfoot-total td { border-top: 2px solid var(--border); padding-top: 14px; }
.grand-total { font-weight: 800; font-size: 18px; font-family: var(--font-display); }

/* Sticky total bar (legacy) */
.summary-totalbar {
  position: sticky; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; margin-left: -22px; margin-right: -22px; margin-bottom: -22px; margin-top: 10px;
  background: linear-gradient(180deg, rgba(243,246,248,0) 0%, rgba(243,246,248,0.55) 12%, rgba(243,246,248,0.9) 22%, #F3F6F8 35%);
  border-top: 1px solid var(--border); backdrop-filter: blur(6px);
}

/* Tables (admin) */
.table-wrap { overflow: auto; }
.shell.is-loading { visibility: hidden; }
#history-card{
  padding: 22px;
  overflow: hidden;
}
#history-card > h2{
  margin: 0 0 10px;
}
#history-card .table-wrap{
  margin: 0;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
#history-card .table-wrap table{
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}
#history-card .history-table th,
#history-card .history-table td{
  padding-left: 22px;
  padding-right: 22px;
}
#history-card .history-table th:first-child,
#history-card .history-table td:first-child{
  padding-left: 22px;
}
#history-card .history-table th:last-child,
#history-card .history-table td:last-child{
  padding-right: 22px;
}
.table { width: 100%; border-collapse: collapse; background: var(--card); }
.table th, .table td { border-bottom: 1px solid var(--border); padding: 10px 8px; text-align: left; }
.table th { color: var(--muted); font-weight: 700; }

/* === Locked state (Lottie + flavor texts) === */
.locked-wrap { display: grid; justify-items: center; gap: 12px; padding-top: 4px; }
.lottie-box { width: min(420px, 100%); height: 260px; margin: 2px auto 0; }
@media (min-width: 860px) { .lottie-box { height: 300px; } }

/* === Timeline (current only highlighted; others greyed) === */
.timeline { padding: 6px 2px; }
.timeline-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: stretch;
}
.timeline-step {
  display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: center;
  padding: 12px 14px; border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background: #F7F9FC; color: var(--muted); opacity: .55;
  transition: opacity .2s ease, transform .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}
.timeline-step .dot {
  width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center;
  background: #EFF3F7; border: 1px solid var(--border); font-size: 18px;
}
.timeline-step.is-current {
  opacity: 1; border-style: solid; transform: translateY(-1px);
  background: #FFFFFF; color: var(--primary);
}
.timeline-step.is-current .dot { background: #FFFFFF; border-color: currentColor; box-shadow: 0 4px 14px rgba(15,38,67,.10); }
.timeline-step.is-current.s-aufgeben { background: #E8F0FF; border-color: #C9DAFF; color: #0F2643; }
.timeline-step.is-current.s-huehner { background: #FFF7E6; border-color: #F7E7BF; color: #8A6A13; }
.timeline-step.is-current.s-abholbereit { background: #E8FBF0; border-color: #C8F0D7; color: #236B3E; }
.timeline-step.is-current.s-abgeschlossen { background: #EDF4FF; border-color: #D8E6FF; color: #0F2643; }
.timeline-step.is-current.s-nichtbezahlt { background: #FFF0F0; border-color: #F5C4C6; color: #7A0C14; }
.timeline-step:not(.is-current):hover { opacity: .75; }

/* === History list === */
.history-row {
  display:flex; align-items:center; justify-content:space-between;
  border:1px solid var(--border); background:#fff; border-radius:var(--radius-sm);
  padding:12px; gap:12px;
}
.history-main { display:flex; flex-direction:column; }
.history-title { font-weight:700; }
.history-right { display:flex; align-items:center; gap:12px; }
.history-total { font-weight:800; min-width: 92px; text-align:right; }

/* Status pills in history (same palette) */
.pill.neutral { background:#F1F5FA; border:1px solid var(--border); color: var(--primary); }
.pill.info { background:#E6F0FF; border:1px solid #D4E2F8; color:#1F4E9A; }
.pill.egg { background:#FFF7E6; border:1px solid #F7E7BF; color:#8A6A13; }
.pill.ready { background:#E8FBF0; border:1px solid #C8F0D7; color:#236B3E; }
.pill.ok { background:#EDF4FF; border:1px solid #D8E6FF; color:#0F2743; }
.pill.warn { background:#FFF0F0; border:1px solid #F5C4C6; color:#7A0C14; }

/* ===================================================== */
/* ========== PERFORMANCE & POOL UI ENHANCEMENTS ======= */
/* ===================================================== */

/* Help browsers skip work until content scrolls into view */
#product-list .prod-card {
  content-visibility: auto;
  contain-intrinsic-size: 360px 220px;
}

/* Garlic pool inline UI */
.pool-inline { margin-top: 8px; display: grid; gap: 8px; }
.pool-inline .head { display:flex; align-items:center; justify-content:space-between; gap: 12px; }
.pool-inline .head .title { font-weight: 700; color: var(--primary); }
.pool-inline .list { display: grid; gap: 8px; }

.pool-line {
  position: relative; /* for absolute hover pill placement */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: #FBFDFE;
}

/* Pool badge */
.pool-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  background: #E8F0FF;
  color: #0F2643;
  border: 1px solid #C9DAFF;
  margin-right: 8px;
}

/* Animated hover pill with participant names */
.hover-pill {
  position: absolute;
  left: 8px;
  top: 100%;
  transform: translateY(6px);
  display: inline-block;
  max-width: min(420px, 70vw);
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-ink);
  border: 1px solid var(--pill-border);
  box-shadow: 0 8px 18px rgba(35,107,62,.12);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  opacity: 0;
  pointer-events: none;
  transition:
    opacity .25s var(--ease),
    transform .25s var(--ease);
}

/* Show on hover (pool list) */
.pool-line:hover .hover-pill { opacity: 1; transform: translateY(0); }

/* Also show inside summary table for pool rows */
.summary-table tr.summary-pool-row .hover-pill {
  position: absolute;
  left: 20px;
  top: calc(100% - 2px);
  transform: translateY(6px);
}
.summary-table tr.summary-pool-row:hover .hover-pill { opacity: 1; transform: translateY(0); }

/* Keep the pill within viewport on tiny screens */
@media (max-width: 520px){
  .hover-pill { left: 0; right: 0; margin-inline: auto; text-align: center; }
}

/* Small mobile spacing tweak requested earlier */
@media (max-width:640px){
  .center-mobile { text-align:center; }
  .center-mobile h2 { margin-bottom: 2px; }
  .center-mobile #delivery-info {
    margin-top: 0;
    margin-bottom: 16px;
  }
}
