/* =====================================================
   Collect module styles — scoped with co- prefix
   Loaded alongside index.html global styles.
   CSS variables from :root in index.html are reused.
   ===================================================== */

/* Extra variables not in main :root */
:root {
  --co-amber-bg: #FFF3E0;
  --co-amber-fg: #E65100;
}

/* ── Page header ── */
.co-page-head {
  padding: 16px 18px 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}
.co-page-head h1 {
  font-family: 'DM Serif Display', serif;
  font-size: 30px;
  line-height: 1;
  color: var(--dark);
  letter-spacing: -0.01em;
}
.co-page-head .co-sub {
  font-size: 13px;
  color: var(--mid);
  margin-top: 4px;
}

/* ── Back / sub-header row ── */
.co-subhead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 4px;
}
.co-iconbtn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.co-iconbtn svg {
  width: 18px;
  height: 18px;
  stroke: var(--dark);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.co-iconbtn.bare {
  background: transparent;
  border: none;
}

/* ── Pill buttons ── */
.co-btn-pill {
  background: #fff;
  border: 1px solid var(--border);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}
.co-btn-pill.solid {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.co-btn-pill:active { opacity: 0.82; }

.co-btn-ghost {
  background: transparent;
  color: var(--green);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  display: block;
}

/* ── Attention / match card ── */
.co-match-card {
  background: #FFFBF0;
  border: 1.5px solid #F3D98B;
  border-radius: 18px;
  padding: 14px 16px;
  margin: 0 16px 10px;
}

/* ── Filter chips ── */
.co-chip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px;
  scrollbar-width: none;
  margin-bottom: 4px;
}
.co-chip-scroll::-webkit-scrollbar { display: none; }
.co-chip {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--mid);
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}
.co-chip.active {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-pale);
}

/* ── Template picker tile ── */
.co-template-tile {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  background: #fff;
  border-radius: 18px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  margin-bottom: 10px;
}
.co-template-tile:active { transform: scale(0.99); }
.co-template-tile.coming-soon {
  opacity: 0.65;
  cursor: default;
}
.co-template-tile .co-tile-ic {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.co-coming-badge {
  background: #F4F4F0;
  color: var(--mid);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: auto;
  white-space: nowrap;
}

/* ── Step progress bar ── */
.co-stepbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px 14px;
}
.co-step {
  flex: 1;
  height: 4px;
  background: #EDEDE8;
  border-radius: 999px;
}
.co-step.done { background: var(--green); }
.co-step.active { background: var(--dark); }

/* ── Toggle switch ── */
.co-switch {
  width: 42px;
  height: 25px;
  background: var(--border);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
  border: none;
}
.co-switch::after {
  content: '';
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 3px;
  left: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: left 0.15s;
}
.co-switch.on { background: var(--green); }
.co-switch.on::after { left: 20px; }

/* ── Progress bar ── */
.co-bar {
  height: 6px;
  background: #EDEDE8;
  border-radius: 999px;
  overflow: hidden;
}
.co-bar > span {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ── Avatar ── */
.co-av {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 13px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* ── Collect-specific input ── */
.co-input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--dark);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.co-input:focus { border-color: var(--green); }
.co-input.mono { font-family: 'Courier New', Courier, monospace; letter-spacing: 0.06em; }

.co-input-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  display: block;
}

/* ── Modal ── */
.co-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 60;
  display: flex;
  align-items: flex-end;
  padding-top: var(--app-safe-top);
  animation: co-fadein 0.2s ease;
}
.co-modal-sheet {
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 22px 20px calc(32px + var(--app-safe-bottom));
  width: 100%;
  max-height: min(88%, calc(100% - var(--app-safe-top)));
  overflow-y: auto;
  animation: co-slideup 0.28s ease;
}
.co-modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

/* ── Toast ── */
.co-toast {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: var(--app-toast-bottom);
  background: var(--dark);
  color: #fff;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 500;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: co-slideup 0.28s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  pointer-events: none;
}

/* ── Confetti ── */
.co-confetti {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: co-fall 1.6s linear forwards;
  opacity: 0.9;
}

/* ── Pulse waiting dot ── */
.co-pulse {
  position: relative;
  width: 14px;
  height: 14px;
}
.co-pulse::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(39,199,223,0.55);
  animation: co-pulse-ring 1.5s ease-out infinite;
}
.co-pulse::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--green-light);
}

/* ── Pressable (tap feedback) ── */
.co-pressable {
  cursor: pointer;
  transition: transform 0.1s, opacity 0.1s;
}
.co-pressable:active { transform: scale(0.985); opacity: 0.88; }

/* ── Public page customer strip ── */
.co-public-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--divider);
}
.co-public-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Stepper (item quantity) ── */
.co-stepper-add {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-green-pale);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.co-stepper-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-green-pale);
  border-radius: 999px;
  padding: 4px 4px;
}
.co-stepper-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Keyframes ── */
@keyframes co-slideup {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes co-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes co-pop {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes co-pulse-ring {
  0%   { transform: scale(0.7); opacity: 1; }
  100% { transform: scale(2);   opacity: 0; }
}
@keyframes co-fall {
  0%   { transform: translateY(-30px) rotate(0);    opacity: 1; }
  100% { transform: translateY(380px) rotate(360deg); opacity: 0; }
}

/* ── Mono / serif utility spans ── */
.co-mono {
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 0.04em;
}
.co-serif {
  font-family: 'DM Serif Display', serif;
}

/* ── Section title (collect-specific padding) ── */
.co-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
  padding: 18px 18px 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

/* ── Public payment CTA ── */
.payment-method-btn {
  width: 100%;
  min-height: 54px;
  border: none;
  border-radius: 16px;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
  text-decoration: none;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: 0 8px 18px rgba(26,26,26,.08);
  transition: transform 0.1s, opacity 0.1s, box-shadow 0.1s;
}
.payment-method-btn:active {
  transform: scale(0.985);
  opacity: 0.9;
  box-shadow: 0 5px 12px rgba(26,26,26,.08);
}
.payment-method-btn > span:first-child {
  flex: 1 1 auto;
  min-width: 0;
}
.payment-method-btn > span:last-child {
  flex: 0 1 auto;
}
.payment-method-btn svg {
  display: block;
}

/* ── Closed collections row ── */
.co-closed-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  text-align: left;
}
.co-closed-row-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #f0ede4;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Archived quiet link ── */
.co-archived-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  color: var(--mid);
  font-family: 'DM Sans', sans-serif;
}

/* ── Demo entry point ── */
.co-demo-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}
.co-demo-link-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #f0ede4;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Mini stat box ── */
.co-mini {
  flex: 1;
  text-align: center;
}
.co-mini .co-big {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  line-height: 1;
}
.co-mini .co-lbl {
  font-size: 10px;
  color: var(--mid);
  font-weight: 500;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Thin info hint bar ── */
.co-hint {
  background: var(--brand-green-pale);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--brand-green-dark);
  line-height: 1.5;
}

/* ── Link-style button row ── */
.co-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 16px 4px;
}
.co-action-row .co-btn-pill {
  flex: 1 1 auto;
  min-width: fit-content;
}
.co-primary-actions {
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
}
.co-primary-actions .co-copy-link-btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px 14px;
}
.co-primary-actions .co-share-action {
  width: 42px;
  height: 42px;
  background: #fff;
  border: 1px solid var(--border);
}

/* ── Manage mode: selection circle ── */
.co-select-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.co-select-circle--on {
  background: #2f9c9b;
  border-color: #2f9c9b;
}
.co-selectable-row {
  transition: background 0.1s;
}
.co-selectable-row--on {
  background: #f0f9f8 !important;
  border-color: #c0e4e4 !important;
}

/* ── Manage mode: sticky bottom action bar ── */
.co-manage-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(28px + var(--app-safe-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 40;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.07);
}

.keyboard-open .co-manage-bar {
  padding-bottom: 12px;
}

.keyboard-open .co-toast {
  bottom: 16px;
}

/* Delete pill variant — red text, no fill */
.co-btn-delete {
  color: #D32F2F !important;
  border-color: rgba(211,47,47,0.25) !important;
}
.co-btn-delete:active {
  opacity: 0.75;
}

/* ── Bulk sheet: compact collection list ── */
.co-sheet-coll-list {
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 4px;
}
.co-sheet-coll-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--divider, #f0ede4);
  background: #fff;
}
.co-sheet-coll-row:last-child {
  border-bottom: none;
}

/* ── Smol text utility ── */
.co-smol {
  font-size: 12px;
  line-height: 1.4;
}
.co-muted { color: var(--mid); }
.co-tiny { font-size: 10.5px; }

/* ── Builder field card — tappable card that opens a bottom sheet ── */
.co-field-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  text-align: left;
  box-sizing: border-box;
}
.co-field-card-ic {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #f5f4f0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.co-field-card-body {
  flex: 1;
  min-width: 0;
}
.co-field-card-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mid);
  margin-bottom: 2px;
}
.co-field-card-val {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.co-field-card-empty {
  color: var(--mid);
  font-weight: 400;
}

/* ── Builder section label ── */
.co-builder-section {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
  margin: 18px 0 10px;
}
