/* ==========================================================================
   account.css — status zamówienia, lista zamówień, pieczątki, nagrody
   ========================================================================== */

.btn-sm { min-height: 36px; padding: 0 14px; border-radius: 12px; font-size: 14px; gap: 4px; }

/* Kolory statusów */
.status-new { --status: #2f7de1; }
.status-preparing { --status: #e8870e; }
.status-ready { --status: var(--success); }
.status-completed { --status: #6f6660; }
.status-cancelled { --status: var(--danger); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--status) 13%, white);
  color: color-mix(in srgb, var(--status) 80%, black);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.status-badge .status-dot { width: 7px; height: 7px; background: var(--status); animation: none; }
.status-badge.status-preparing .status-dot, .status-badge.status-new .status-dot { animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* --- Ekran statusu --- */
.order-top { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: calc(var(--safe-top) + 24px) var(--gutter) 0; text-align: center; }
.thanks { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 10px; }
.thanks .success-mark { width: 64px; height: 64px; }
.thanks h2 { font-size: 23px; }
.order-top .order-number { margin-top: 0; }

.status-card {
  padding: 20px 16px 18px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.status-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.status-hero h1 { font-size: 22px; margin-top: 8px; }
.status-hero p { color: var(--text-muted); font-size: 15px; }
.status-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--status) 13%, white);
  color: var(--status);
}
.status-preparing .status-icon svg { animation: flicker 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.08, 0.95) rotate(-3deg); } 60% { transform: scale(0.96, 1.06) rotate(3deg); } }
.status-ready .status-icon::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--status);
  animation: ping 1.6s ease-out infinite;
}
.status-changed { animation: status-in 0.6s var(--ease-spring); }
@keyframes status-in { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* Oś czasu: 3 kroki w poziomie */
.timeline { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 22px; }
.tl-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; }
.tl-step::before {
  content: "";
  position: absolute;
  top: 11px;
  right: 50%;
  width: 100%;
  height: 3px;
  background: var(--line);
  z-index: 0;
}
.tl-step:first-child::before { display: none; }
.tl-step.is-done::before, .tl-step.is-current::before { background: var(--brand); transition: background-color 0.4s; }
.tl-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--line);
  color: var(--brand-contrast);
  transition: background-color 0.3s, border-color 0.3s;
}
.tl-step.is-done .tl-dot { background: var(--brand); border-color: var(--brand); }
.tl-step.is-current .tl-dot { border-color: var(--brand); box-shadow: 0 0 0 5px var(--brand-soft); }
.tl-step.is-current .tl-dot::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); animation: blink 1.2s ease-in-out infinite; }
.tl-label { font-weight: 650; line-height: 1.2; }
.tl-step.is-todo .tl-label { color: var(--text-faint); }
.tl-time { color: var(--text-muted); font-variant-numeric: tabular-nums; min-height: 1em; }

.demo-note { margin-top: 16px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.03em; color: #8a5a00; }

.order-facts > a { display: flex; gap: 14px; align-items: center; padding: 12px 0; font-size: 15px; }
.order-facts > a span { flex: 1; }
.order-facts > a > svg:last-child { width: 18px; height: 18px; color: var(--text-faint); }
.summary-row.discount { color: var(--success); font-weight: 650; }
.summary-row.discount span:first-child { display: inline-flex; align-items: center; gap: 6px; }

/* Pieczątki zdobyte za zamówienie */
.earned-stamps { padding: 16px; border-radius: 22px; background: var(--accent-soft); }
.earned-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 15px; }
.earned-title svg { color: color-mix(in srgb, var(--accent) 55%, black); }
.earned-link { display: inline-flex; align-items: center; gap: 2px; margin-top: 12px; font-size: 14px; font-weight: 650; color: var(--brand); }

/* --- Karta pieczątek --- */
.stamp-card {
  --stamp-bg: var(--brand);
  padding: 16px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--brand-contrast) 14%, transparent) 0 90px, transparent 91px),
    linear-gradient(150deg, var(--brand), var(--brand-strong));
  color: var(--brand-contrast);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--brand) 30%, transparent);
}
.stamp-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.stamp-card-head img { width: 38px; height: 38px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--brand-contrast) 35%, transparent); }
.stamp-card-head div { flex: 1; display: flex; flex-direction: column; }
.stamp-card-head strong { font-size: 15px; }
.stamp-card-head div span { font-size: 12px; opacity: 0.8; }
.stamp-count { font-size: 14px; opacity: 0.9; }
.stamp-count b { font-size: 24px; font-weight: 800; }
.stamp-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.stamp {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px dashed color-mix(in srgb, var(--brand-contrast) 40%, transparent);
  font-size: 13px;
  font-weight: 700;
  color: color-mix(in srgb, var(--brand-contrast) 55%, transparent);
}
.stamp.is-filled {
  border: 0;
  background: var(--brand-contrast);
  color: var(--brand);
  transform: rotate(var(--rot));
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}
.stamp.is-filled svg { width: 62%; height: 62%; }
.stamp.is-reward:not(.is-filled) { border-style: solid; background: color-mix(in srgb, var(--brand-contrast) 14%, transparent); color: var(--brand-contrast); }
.stamp.is-new { animation: stamp-in 0.5s var(--ease-spring) both; animation-delay: var(--delay); }
@keyframes stamp-in {
  0% { transform: scale(2.2) rotate(calc(var(--rot) - 25deg)); opacity: 0; }
  60% { transform: scale(0.9) rotate(var(--rot)); opacity: 1; }
  100% { transform: scale(1) rotate(var(--rot)); opacity: 1; }
}
.stamp-progress { margin-top: 12px; text-align: center; font-size: 14.5px; color: var(--text-muted); }
.stamp-progress strong { color: var(--text); }

/* Nagroda */
.reward-card, .reward-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: var(--accent-soft);
  border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.reward-card div, .reward-banner div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.reward-card strong, .reward-banner strong { font-size: 15px; }
.reward-card span:not(.reward-icon), .reward-banner div span { font-size: 13px; color: var(--text-muted); }
.reward-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-contrast);
  animation: wiggle 2.4s ease-in-out infinite;
}
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-10deg); } 90% { transform: rotate(8deg); } 95% { transform: rotate(-4deg); } }
.reward-slot:not(:empty) { margin: 14px var(--gutter) 0; }
.reward-banner.is-applied { background: color-mix(in srgb, var(--success) 10%, white); border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.reward-banner.is-applied .reward-icon { background: var(--success); color: #fff; animation: none; }
.stamps-note { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--text-muted); }

.how-list { display: grid; gap: 12px; }
.how-list li { display: flex; gap: 12px; }
.how-list li > span {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
}
.how-list div { display: flex; flex-direction: column; font-size: 14px; color: var(--text-muted); }
.how-list strong { font-size: 15px; color: var(--text); }

.stamp-history { padding: 4px 16px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.stamp-history li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.stamp-history li:last-child { border-bottom: 0; }
.stamp-history small { display: block; font-size: 12.5px; color: var(--text-muted); }
.stamp-history .plus { color: var(--success); }
.stamp-history .used { font-size: 12.5px; color: var(--brand); margin-left: 6px; }

.demo-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 8px auto 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px dashed #d9b35c;
  color: #8a5a00;
  font-size: 12.5px;
  font-weight: 700;
}
.form-section:has(> .demo-tool) { text-align: center; }

/* --- Lista zamówień --- */
.active-list { display: grid; gap: 10px; }
.active-order {
  display: block;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--status);
  transition: transform 0.15s var(--ease-out);
}
.active-order:active { transform: scale(0.98); }
.active-order-top { display: flex; justify-content: space-between; align-items: center; }
.active-order-no { font-size: 14px; color: var(--text-muted); }
.active-order-no b { font-size: 20px; color: var(--text); }
.active-order-pickup { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-weight: 650; }
.active-order-items { margin-top: 4px; font-size: 14px; color: var(--text-muted); }
.active-order-link { display: inline-flex; align-items: center; gap: 2px; margin-top: 10px; font-size: 14px; font-weight: 650; color: var(--brand); }

.history-list { display: grid; gap: 10px; }
.history-order { padding: 14px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.history-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.history-head div { display: flex; flex-direction: column; }
.history-head span:not(.status-badge) { font-size: 13px; color: var(--text-muted); }
.history-items { margin-top: 8px; font-size: 14px; color: var(--text-muted); }
.history-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.history-foot strong { font-size: 17px; }
