:root {
  --bg: #FAFAFA;
  --panel: #ffffff;
  --tile: #fafaf8;
  --ink: #161d1f;
  --muted: #6b7785;
  --line: #ececea;
  --accent: #3D6BFF;
  --accent-dark: #2549c4;
  --orange: #ee8b1a;
  --red: #DD2E44;
  --blue-hero: #1a8fd4;
}

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

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Topbar ---------- */

.crt-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.crt-brand-link {
  display: inline-block;
  line-height: 0;
  transition: opacity 0.15s;
}
.crt-brand-link:hover { opacity: 0.75; }
.crt-brand-logo {
  height: 28px;
  width: auto;
  display: block;
}
.crt-step {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ---------- Main / Intro ---------- */

.crt-main {
  flex: 1;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 32px 80px;
}

.crt-intro {
  text-align: left;
  margin-bottom: 40px;
}
.crt-headline {
  margin: 0 0 14px;
  font-family: "Fredoka", "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  font-weight: 400;
}
.crt-mici {
  font-weight: 600;
  font-size: 0.84em;
  color: var(--blue-hero);
}
.crt-mari {
  font-weight: 700;
  font-size: 1.12em;
  color: var(--orange);
}
.crt-sub {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.65;
  color: var(--muted);
  font-weight: 400;
}

/* ---------- Item list ---------- */

.crt-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.crt-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.crt-item-keychain {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--tile);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.crt-item-keychain img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  display: block;
}
.crt-item-keychain.is-empty {
  border: 2px dashed #c8c8c2;
  color: var(--muted);
  font-size: 22px;
  background: transparent;
}

.crt-item-body {
  flex: 1;
  min-width: 0;
}
.crt-item-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.crt-item-title em {
  font-style: normal;
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
  font-weight: 600;
  color: var(--accent);
}
.crt-item-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.crt-color-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.crt-color-chip .crt-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: inline-block;
}
.crt-color-chip-label {
  color: var(--ink);
  font-weight: 500;
}
.crt-letter-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-top: 4px;
}
.crt-letter-line .crt-letter-label {
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
  font-weight: 600;
  color: var(--ink);
  background: var(--tile);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.crt-item-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}
.crt-item-qty {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 24px;
  text-align: center;
}

/* circular buttons */
.crt-circ {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  color: white;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s, filter 0.12s;
  font-family: inherit;
  padding: 0;
}
.crt-circ:hover { filter: brightness(1.05); transform: translateY(-1px); }
.crt-circ:active { transform: translateY(0); }
.crt-circ--minus { background: var(--red); box-shadow: 0 2px 0 #a51c2c; }
.crt-circ--plus  { background: var(--accent); box-shadow: 0 2px 0 var(--accent-dark); }

/* ---------- Empty state ---------- */

.crt-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--muted);
  font-size: 17px;
}

/* ---------- Total ---------- */

.crt-total-row {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 10px;
  padding: 14px 20px;
  margin-bottom: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
}
.crt-total-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.crt-total {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- + Adauga button ---------- */

.crt-add {
  display: block;
  width: 100%;
  padding: 14px 20px;
  margin-bottom: 14px;
  background: transparent;
  border: 1.5px dashed var(--orange);
  border-radius: 14px;
  color: var(--orange);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
}
.crt-add:hover {
  background: rgba(238, 139, 26, 0.06);
}

/* ---------- Picker (dropdown) ---------- */

.crt-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-bottom: 0;
  transition: max-height 0.3s ease, margin-bottom 0.3s ease, opacity 0.2s ease;
}
.crt-picker.is-open {
  max-height: 290px;
  padding-top: 10px;
  margin-bottom: 20px;
  opacity: 1;
}
.crt-pick-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 14px;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.crt-pick-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(61, 107, 255, 0.12);
}
.crt-pick-logo {
  width: 88%;
  max-width: 200px;
  height: auto;
  max-height: 44px;
  object-fit: contain;
  display: block;
}
.crt-pick-sub {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Plateste ---------- */

.crt-pay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 22px;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--accent-dark), 0 4px 14px rgba(61, 107, 255, 0.25);
  transition: transform 0.08s, box-shadow 0.08s;
}
.crt-pay:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 0 var(--accent-dark), 0 6px 18px rgba(61, 107, 255, 0.32);
}
.crt-pay:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--accent-dark), 0 2px 6px rgba(61, 107, 255, 0.2);
}

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
  .crt-topbar { padding: 14px 20px; }
  .crt-main { padding: 32px 20px 60px; }
  .crt-mari { display: block; }

  .crt-item { padding: 12px; gap: 10px; }
  .crt-item-keychain { flex: 0 0 48px; width: 48px; height: 48px; }
  .crt-item-title { font-size: 14px; }
  .crt-item-row { font-size: 12px; gap: 8px; }
  .crt-letter-line { font-size: 12px; gap: 8px; }
  .crt-circ { width: 28px; height: 28px; font-size: 17px; }

  .crt-total-row { padding: 12px 16px; margin-bottom: 18px; }
  .crt-total { font-size: 20px; }

  .crt-picker { grid-template-columns: 1fr; gap: 10px; }
  .crt-picker.is-open { max-height: 540px; padding-top: 8px; }
  .crt-pick-tile { padding: 16px 14px; gap: 8px; }
  .crt-pick-logo { max-height: 38px; max-width: 220px; }

  .crt-add { padding: 12px 16px; font-size: 14px; }
  .crt-pay { padding: 14px 18px; font-size: 15px; }
}
