/* Diss na Raka — zgody i prywatność */

.cfc-page,
.cfc-modal,
.cfc-banner {
  --cfc-ink: #0f0d0e;
  --cfc-ink-2: #1c1517;
  --cfc-paper: #ffffff;
  --cfc-cream: #f6f4ef;
  --cfc-red: #e11e36;
  --cfc-red-deep: #b71428;
  --cfc-green: #1f8a5b;
  --cfc-text: #1a1718;
  --cfc-text-2: #6b6566;
  --cfc-line: rgba(15, 13, 14, 0.12);
  --cfc-line-2: rgba(15, 13, 14, 0.2);
  --cfc-mono: "Azeret Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --cfc-sans: Poppins, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
}

.cfc-page *,
.cfc-modal *,
.cfc-banner * {
  box-sizing: border-box;
}

.cfc-page .screen-reader-text,
.cfc-modal .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- wspólne elementy ---------- */

.cfc-tag {
  display: inline-block;
  font-family: var(--cfc-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cfc-red);
  padding: 0 0 0 14px;
  position: relative;
  margin-bottom: 10px;
}

.cfc-tag::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 1px;
  background: var(--cfc-red);
}

.cfc-tag--light {
  color: #ff6d84;
}

.cfc-tag--light::before {
  background: #ff6d84;
}

.cfc-btn {
  font-family: var(--cfc-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 14px 22px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.cfc-btn:focus-visible {
  outline: 2px solid var(--cfc-red);
  outline-offset: 3px;
}

.cfc-btn--primary {
  background: var(--cfc-red);
  border-color: var(--cfc-red);
  color: #fff;
}

.cfc-btn--primary:hover {
  background: var(--cfc-red-deep);
  border-color: var(--cfc-red-deep);
}

.cfc-btn--ghost {
  background: transparent;
  border-color: var(--cfc-line-2);
  color: var(--cfc-ink);
}

.cfc-btn--ghost:hover {
  border-color: var(--cfc-ink);
}

.cfc-btn--ghost-light {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.cfc-btn--ghost-light:hover {
  border-color: #fff;
}

.cfc-btn--line {
  background: var(--cfc-ink);
  border-color: var(--cfc-ink);
  color: #fff;
}

.cfc-btn--line:hover {
  background: #000;
}

.cfc-btn--link {
  background: none;
  border: none;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 14px 8px;
}

.cfc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.cfc-foot-note {
  font-family: var(--cfc-sans);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--cfc-text-2);
  margin: 16px 0 0;
}

.cfc-foot-note a,
.cfc-banner-text a {
  color: inherit;
  text-underline-offset: 3px;
}

/* ---------- wiersz kategorii ---------- */

.cfc-row {
  border-top: 1px solid var(--cfc-line);
  padding: 22px 0;
}

.cfc-row:first-child {
  border-top: none;
}

.cfc-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.cfc-row-id .cfc-tag {
  margin-bottom: 6px;
}

.cfc-row-title {
  font-family: var(--cfc-sans);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--cfc-ink);
  margin: 0;
}

.cfc-row-summary {
  font-family: var(--cfc-sans);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--cfc-text);
  margin: 10px 0 0;
  max-width: 62ch;
}

.cfc-lock {
  font-family: var(--cfc-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cfc-text-2);
  border: 1px dashed var(--cfc-line-2);
  border-radius: 999px;
  padding: 8px 12px;
  white-space: nowrap;
  flex: none;
}

/* przełącznik */

.cfc-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  flex: none;
}

.cfc-switch:focus-visible {
  outline: 2px solid var(--cfc-red);
  outline-offset: 3px;
  border-radius: 4px;
}

.cfc-switch-track {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #d8d4d0;
  transition: background-color 0.2s ease;
  flex: none;
}

.cfc-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.cfc-switch[aria-checked="true"] .cfc-switch-track {
  background: var(--cfc-green);
}

.cfc-switch[aria-checked="true"] .cfc-switch-thumb {
  transform: translateX(20px);
}

.cfc-switch-label {
  font-family: var(--cfc-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cfc-text-2);
  min-width: 68px;
  text-align: left;
}

.cfc-switch[aria-checked="true"] .cfc-switch-label {
  color: var(--cfc-green);
}

/* szczegóły */

.cfc-details {
  margin-top: 14px;
}

.cfc-details > summary {
  font-family: var(--cfc-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cfc-text-2);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.cfc-details > summary::-webkit-details-marker {
  display: none;
}

.cfc-details > summary::before {
  content: "+";
  font-size: 14px;
  line-height: 1;
  color: var(--cfc-red);
}

.cfc-details[open] > summary::before {
  content: "–";
}

.cfc-details > summary:hover {
  color: var(--cfc-ink);
}

.cfc-details-body {
  padding: 14px 0 4px;
}

.cfc-details-note {
  font-family: var(--cfc-sans);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--cfc-text-2);
  margin: 0 0 14px;
  max-width: 62ch;
}

.cfc-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--cfc-mono);
  font-size: 11.5px;
}

.cfc-table th {
  text-align: left;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--cfc-text-2);
  border-bottom: 1px solid var(--cfc-line);
  padding: 0 12px 8px 0;
}

.cfc-table td {
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--cfc-line);
  color: var(--cfc-text);
  vertical-align: top;
  line-height: 1.45;
}

.cfc-table code {
  font-family: var(--cfc-mono);
  font-size: 11.5px;
  background: var(--cfc-cream);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--cfc-ink);
}

/* ---------- podstrona ---------- */

.cfc-page {
  font-family: var(--cfc-sans);
  color: var(--cfc-text);
  background: var(--cfc-paper);
  padding: 72px 24px 96px;
}

.cfc-hero {
  max-width: 1120px;
  margin: 0 auto 48px;
}

.cfc-hero-title {
  font-family: var(--cfc-sans);
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--cfc-ink);
  margin: 0 0 20px;
}

.cfc-hero-lead {
  font-size: 16px;
  line-height: 1.7;
  color: var(--cfc-text-2);
  max-width: 58ch;
  margin: 0;
}

.cfc-layout {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 56px;
  align-items: start;
}

/* ---------- sygnatura: paragon zgody ---------- */

.cfc-receipt {
  position: sticky;
  top: 32px;
}

.cfc-receipt-paper {
  background: var(--cfc-cream);
  padding: 26px 24px 28px;
  font-family: var(--cfc-mono);
  position: relative;
  box-shadow: 0 18px 44px -26px rgba(15, 13, 14, 0.45);
}

/* perforowana krawędź u dołu */
.cfc-receipt-paper::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -9px;
  height: 10px;
  background:
    radial-gradient(circle at 5px 0, transparent 5px, var(--cfc-cream) 5.5px) repeat-x;
  background-size: 14px 10px;
  filter: drop-shadow(0 8px 10px rgba(15, 13, 14, 0.12));
}

.cfc-receipt-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--cfc-line-2);
}

.cfc-receipt-brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--cfc-ink);
}

.cfc-receipt-kind {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cfc-text-2);
}

.cfc-receipt-lines {
  margin: 16px 0;
  padding: 0;
}

.cfc-receipt-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11.5px;
  padding: 7px 0;
}

.cfc-receipt-line dt {
  color: var(--cfc-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
  white-space: nowrap;
}

/* wiodące kropki jak na wydruku kasowym */
.cfc-receipt-dots {
  flex: 1;
  border-bottom: 1px dotted var(--cfc-line-2);
  transform: translateY(-3px);
}

.cfc-receipt-line dd {
  margin: 0;
  font-weight: 600;
  white-space: nowrap;
}

.cfc-receipt-line dd[data-state="on"] {
  color: var(--cfc-green);
}

.cfc-receipt-line dd[data-state="off"] {
  color: var(--cfc-text-2);
}

.cfc-receipt-line dd[data-state="fixed"] {
  color: var(--cfc-ink);
}

.cfc-receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 0;
  border-top: 1px dashed var(--cfc-line-2);
  border-bottom: 1px dashed var(--cfc-line-2);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cfc-text-2);
}

.cfc-receipt-total strong {
  font-size: 24px;
  letter-spacing: 0;
  color: var(--cfc-ink);
}

.cfc-receipt-meta {
  display: grid;
  gap: 10px;
  padding: 16px 0 0;
  font-size: 10.5px;
}

.cfc-receipt-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.cfc-receipt-meta span {
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cfc-text-2);
}

.cfc-receipt-meta b {
  color: var(--cfc-ink);
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.cfc-receipt-note {
  font-family: var(--cfc-sans);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--cfc-text-2);
  margin: 18px 0 0;
}

/* ---------- baner ---------- */

.cfc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99990;
  background: var(--cfc-ink);
  color: #fff;
  border-top: 2px solid var(--cfc-red);
  animation: cfc-rise 0.32s ease both;
}

@keyframes cfc-rise {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.cfc-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.cfc-banner-copy {
  flex: 1 1 420px;
  min-width: 0;
}

.cfc-banner-text {
  font-family: var(--cfc-sans);
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.86);
  margin: 0;
  max-width: 68ch;
}

.cfc-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- modal ---------- */

.cfc-modal {
  position: fixed;
  inset: 0;
  z-index: 99995;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* [hidden] musi wygrać z display:flex powyżej */
.cfc-modal[hidden],
.cfc-banner[hidden] {
  display: none;
}

.cfc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 7, 9, 0.62);
  backdrop-filter: blur(2px);
}

.cfc-modal-card {
  position: relative;
  background: var(--cfc-paper);
  width: min(720px, 100%);
  max-height: min(86vh, 860px);
  display: flex;
  flex-direction: column;
  border-radius: 6px;
  overflow: hidden;
  animation: cfc-pop 0.22s ease both;
}

@keyframes cfc-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

.cfc-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 26px 18px;
  border-bottom: 1px solid var(--cfc-line);
}

.cfc-modal-title {
  font-family: var(--cfc-sans);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--cfc-ink);
  margin: 0;
}

.cfc-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--cfc-text-2);
  cursor: pointer;
  padding: 0 4px;
}

.cfc-close:hover {
  color: var(--cfc-ink);
}

.cfc-close:focus-visible {
  outline: 2px solid var(--cfc-red);
  outline-offset: 3px;
}

.cfc-modal-body {
  padding: 6px 26px 10px;
  overflow-y: auto;
}

.cfc-modal-foot {
  padding: 18px 26px 24px;
  border-top: 1px solid var(--cfc-line);
  background: var(--cfc-cream);
}

.cfc-modal-foot .cfc-actions {
  margin-top: 0;
}

/* ---------- responsywność ---------- */

@media (max-width: 1000px) {
  .cfc-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .cfc-receipt {
    position: static;
    max-width: 420px;
  }
}

@media (max-width: 640px) {
  .cfc-page {
    padding: 48px 18px 72px;
  }

  .cfc-row-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .cfc-actions .cfc-btn {
    flex: 1 1 100%;
    text-align: center;
  }

  .cfc-banner-inner {
    padding: 18px;
    gap: 16px;
  }

  .cfc-banner-actions {
    width: 100%;
  }

  .cfc-banner-actions .cfc-btn--primary,
  .cfc-banner-actions .cfc-btn--ghost-light {
    flex: 1 1 auto;
  }

  .cfc-table thead {
    display: none;
  }

  .cfc-table tr {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--cfc-line);
  }

  .cfc-table td {
    display: block;
    border: none;
    padding: 2px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cfc-banner,
  .cfc-modal-card {
    animation: none;
  }

  .cfc-switch-thumb,
  .cfc-switch-track,
  .cfc-btn {
    transition: none;
  }
}
