/* LeadForm.module.css
   Same design language as BatchForm.module.css — full-page form, step
   badges, card sections, teal accent.

   If you'd rather have ONE stylesheet for both, delete this file and change
   the import in LeadForm.tsx to point at your existing BatchForm.module.css.
   Every class name below matches the ones BatchForm already uses, so the
   swap is a one-line change. */

/* ── Page shell ─────────────────────────────────────────────────────── */
.page {
  min-height: 100vh;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.topbarLeft {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.backBtn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.backBtn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.backBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pageTitle {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.pageSub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #64748b;
}

.topbarActions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.content {
  flex: 1;
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btnPrimary {
  padding: 9px 20px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.28);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btnPrimary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.38);
}
.btnPrimary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.btnGhost {
  padding: 9px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btnGhost:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.btnGhost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btnDanger {
  padding: 9px 18px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btnDanger:hover:not(:disabled) {
  background: #fee2e2;
}

/* ── Cards ──────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 18px;
  overflow: visible;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.cardHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.cardHeadLeft {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.stepBadge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.cardTitle {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
}

.cardHint {
  margin: 2px 0 0;
  font-size: 12px;
  color: #64748b;
}

.cardBody {
  padding: 20px;
}

/* ── Form grid ──────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.half {
  grid-column: span 1;
}

.full {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.label,
.field > label,
.full > label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.01em;
}

/* Red asterisk on required fields */
.req::after {
  content: ' *';
  color: #dc2626;
  font-weight: 700;
}

.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13.5px;
  color: #0f172a;
  background: #fff;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.input:disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

.textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13.5px;
  color: #0f172a;
  background: #fff;
  outline: none;
  resize: vertical;
  font-family: inherit;
  line-height: 1.55;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.helper {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.45;
}

.errorText {
  font-size: 11.5px;
  color: #dc2626;
  font-weight: 600;
}

/* ── Group toggle (client group / status / priority) ────────────────── */
.groupToggle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.groupBtn {
  position: relative;
  padding: 9px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.groupBtn:hover:not(:disabled) {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.groupBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.groupBtnActive {
  border-color: #0f766e;
  background: #f0fdfa;
  color: #0f766e;
}

.groupCheck {
  font-size: 11px;
  font-weight: 700;
  color: #0f766e;
}

/* Legacy values keep the QRS palette but carry a muted marker */
.groupBtnLegacy .groupTag {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #64748b;
}
.groupBtnActive .groupTag {
  background: #ccfbf1;
  color: #0f766e;
}

/* ── Repeating rows (tags, standards) ───────────────────────────────── */
.tagRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.tagChip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 99px;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  font-size: 12px;
  font-weight: 600;
}

.tagRemove {
  border: none;
  background: transparent;
  color: #4338ca;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  opacity: 0.65;
}
.tagRemove:hover {
  opacity: 1;
}

.addRowBtn {
  align-self: flex-start;
  padding: 7px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f766e;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.addRowBtn:hover {
  border-color: #14b8a6;
  background: #f0fdfa;
}

.iconBtnDanger {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.iconBtnDanger:hover {
  background: #fee2e2;
}

/* ── Notice blocks ──────────────────────────────────────────────────── */
.note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 10px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  color: #115e59;
  font-size: 12.5px;
  line-height: 1.55;
  margin-top: 4px;
}

.warn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 12.5px;
  line-height: 1.55;
  margin-bottom: 14px;
}

.warnList {
  margin: 6px 0 0;
  padding-left: 18px;
}
.warnList li {
  margin-bottom: 3px;
}

/* ── Ownership / notify switch ──────────────────────────────────────── */
.switchRow {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.switchRow input[type='checkbox'] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: #0f766e;
  cursor: pointer;
  flex-shrink: 0;
}

.switchLabel {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  display: block;
}

.switchHint {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.45;
}

/* ── Handover preview ───────────────────────────────────────────────── */
.handoverPreview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  font-size: 13px;
  color: #115e59;
  flex-wrap: wrap;
}

.avatar {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 99px;
  background: #0f766e;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.arrow {
  color: #14b8a6;
  font-weight: 700;
}

/* ── Loading ────────────────────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: #64748b;
  font-size: 13.5px;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .content {
    padding: 16px 14px 48px;
  }
  .topbar {
    padding: 12px 14px;
    flex-wrap: wrap;
  }
  .topbarActions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btnPrimary,
  .btnGhost,
  .backBtn,
  .groupBtn,
  .input,
  .textarea {
    transition: none;
  }
  .btnPrimary:hover:not(:disabled) {
    transform: none;
  }
}
