*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
[x-cloak] {
  display: none !important;
}

:root {
  --font: "Geist", system-ui, sans-serif;
  --color-primary: #8236fb;
  --color-primary-hover: #6d1fe8;
  --color-fg: #1f2527;
  --color-fg-muted: #425257;
  --color-bg: #ffffff;
  --color-muted: #f0f4f5;
  --color-border: #e2ebee;
  --color-input: #bccdd2;
}

body {
  font-family: var(--font);
  background: #f9fafb;
}

/* ── Modal ── */
.modal {
  background: var(--color-bg);
  border-radius: 12px;
  box-shadow:
    0px 4px 6px -4px rgba(31, 37, 39, 0.12),
    0px 10px 15px -3px rgba(31, 37, 39, 0.12),
    0px 0px 15px rgba(31, 37, 39, 0.06);
}

/* ── Recessed ── */
.modal-recessed {
  background: var(--color-muted);
  box-shadow: inset 0px 0px 4px rgba(31, 37, 39, 0.08);
  border-radius: 12px;
}

/* ── Scroll ── */
.modal-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--color-input) transparent;
}
.modal-scroll::-webkit-scrollbar {
  width: 6px;
}
.modal-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.modal-scroll::-webkit-scrollbar-thumb {
  background: var(--color-input);
  border-radius: 9999px;
}

/* ── Section card ── */
.section-card {
  background: var(--color-bg);
  border-radius: 8px;
  outline: 1px solid var(--color-border);
  outline-offset: -1px;
}

/* ── Section title ── */
.section-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  color: var(--color-fg);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Info icon and tooltip styles ── */
.tooltip-container {
  position: relative;
  display: inline-block;
}

.tooltip-container svg {
  cursor: pointer;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.tooltip-content {
  visibility: hidden;
  width: 320px;
  background-color: var(--color-primary);
  color: #fff;
  text-align: left;
  border-radius: 6px;
  padding: 10px;
  position: absolute;
  z-index: 10;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  line-height: 1.3;
  margin: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tooltip-content p {
  margin-bottom: 6px;
}

.tooltip-content ul {
  padding-left: 16px;
  margin: 0;
  list-style-type: disc;
}

.tooltip-container svg:focus + .tooltip-content,
.tooltip-container svg:hover + .tooltip-content {
  visibility: visible;
}

/* ── Label ── */
.lbl {
  font-size: 14px;
  font-weight: 500;
  line-height: 17.5px;
  color: var(--color-fg);
}

/* ── Inputs ── */
.inp,
.sel,
.txa {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 17.5px;
  color: var(--color-fg);
  background: var(--color-bg);
  border: none;
  outline: 1px solid var(--color-input);
  outline-offset: -1px;
  border-radius: 6px;
  width: 100%;
  transition:
    outline-color 0.15s,
    box-shadow 0.15s;
}
.inp,
.sel {
  height: 40px;
  padding: 10px 12px;
}
.inp-sm,
.sel-sm {
  height: 34px;
  padding: 8px 12px;
}
.txa {
  padding: 10px 12px;
  min-height: 95px;
  resize: vertical;
}

.inp:focus,
.sel:focus,
.txa:focus {
  outline-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(130, 54, 251, 0.12);
}
.inp.err,
.sel.err,
.txa.err {
  outline-color: #ef4444;
}

/* ── Select ── */
.sel-wrap {
  position: relative;
}
.sel-wrap::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  width: 9px;
  height: 5px;
  background: var(--color-fg);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.sel {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  cursor: pointer;
}

/* ── Date input ── */
.date-wrap {
  position: relative;
}
.date-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  width: 16px;
  height: 16px;
}
.inp-date {
  padding-left: 36px;
}

/* ── Placeholder ── */
::placeholder {
  color: var(--color-fg-muted);
}
.sel option[value=""] {
  color: var(--color-fg-muted);
}
.sel option {
  color: var(--color-fg);
}

/* ── Validation ── */
.e-msg {
  font-size: 12px;
  color: #ef4444;
  margin-top: -4px;
}

/* ── Checkbox ── */
.chk-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.chk-row input[type="checkbox"] {
  display: none;
}
.chk-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--color-input);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--color-bg);
  transition:
    background 0.1s,
    border-color 0.1s;
}
.chk-row input[type="checkbox"]:checked + .chk-box {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.chk-row input[type="checkbox"]:checked + .chk-box::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}
.chk-lbl {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-fg);
  user-select: none;
}

/* ── Error banner ── */
.err-banner {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: #dc2626;
}

/* ── Submit button ── */
.btn-submit {
  height: 34px;
  min-width: 80px;
  line-height: 34px;
  padding: 0px 12px;
  background: var(--color-primary);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-submit:hover {
  background: var(--color-primary-hover);
}
.btn-submit:disabled {
  background: var(--color-input);
  cursor: not-allowed;
}

/* ── Mobile ── */
@media (max-width: 700px) {
  body {
    padding: 0;
    align-items: stretch;
  }

  .modal {
    min-width: unset !important;
    width: 100% !important;
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
  }
  .modal-recessed {
    margin: 0 8px 8px !important;
    padding-bottom: 60px;
  }
  .modal-scroll {
    max-height: unset !important;
    overflow-y: visible !important;
  }
  .modal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -2px 8px rgba(31, 37, 39, 0.08);
    padding: 12px 16px !important;
  }
}

/* ── New thin and small styles for inputs, textareas, and labels ── */
.inp-thin {
  font-size: 12px;
  line-height: 15px;
  padding: 6px 8px;
  outline-width: 1px;
  height: 32px;
}
.inp-small {
  font-size: 11px;
  line-height: 14px;
  padding: 4px 6px;
  outline-width: 1px;
  height: 28px;
}
.txa-thin {
  font-size: 12px;
  line-height: 15px;
  padding: 6px 8px;
  outline-width: 1px;
  min-height: 60px;
}
.txa-small {
  font-size: 11px;
  line-height: 14px;
  padding: 4px 6px;
  outline-width: 1px;
  min-height: 50px;
}
.lbl-small {
  font-size: 11px;
  line-height: 14px;
  font-weight: 500;
}
