/* ============================================================
   Nutt Labs · Tally form system · v2.16
   Source of truth: flywheel.nutt.ai/platforms/tally/nutt-labs-tally.css (R2)
   Linked from Tally > Domains > form.nutt.ai > Code injection:
   <link rel="stylesheet" href="https://flywheel.nutt.ai/brand/nutt-labs-tokens.css?v=1.8">
   <link rel="stylesheet" href="https://flywheel.nutt.ai/brand/nutt-labs-components.css?v=1.1">
   <link rel="stylesheet" href="https://flywheel.nutt.ai/platforms/tally/nutt-labs-tally.css?v=2.16">
   <script src="https://flywheel.nutt.ai/platforms/tally/nutt-labs-tally.js?v=2.2"></script>
   After each upload, bump that file's ?v= in the injection.
   Rules:
   1. Only Tally's documented public classes (tally.so/help/add-custom-styles).
   2. Style plain elements inside a documented class; never Tally's generated classes.
   3. Colors, font, radius and sizes also live in each form's Customize panel,
      so if a rule ever stops matching, the form falls back to the same look.
   4. Design values come from brand/nutt-labs-tokens.css; never hard-code them here.
   ============================================================ */

/* ---------- Base ---------- */
html, .tally-app { background-color: var(--nl-surface); }
.tally-app, .tally-app input, .tally-app textarea, .tally-app button { font-family: var(--nl-font) !important; }
.tally-app { color: var(--nl-text); }

/* ---------- Text ---------- */
.tally-block-form-title h1 { font-size: 40px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; color: var(--nl-text); padding-bottom: 16px !important; }
.tally-block-text { color: var(--nl-muted); }
.tally-app .tally-block-text .tally-text:not([data-nl-style]) a { color: var(--nl-link) !important; text-decoration-color: currentColor !important; }
.tally-block-text b, .tally-block-text strong, .tally-block-text [style*="font-weight: bold"] { font-weight: 600 !important; }
/* Intro: the text blocks directly under the form title */
.tally-block-form-title + .tally-block-text,
.tally-block-form-title + .tally-block-text + .tally-block-text { font-size: 17px; line-height: 1.55; color: var(--nl-text); }
.tally-block-form-title + .tally-block-text + .tally-block-text { padding-top: var(--nl-form-paragraph-gap) !important; }
/* Style tags (callout, small, …) come from brand/nutt-labs-components.css; this only spaces the block */
.tally-app .tally-block-text:has(> [data-nl-style~="callout"]) { padding-top: 28px !important; }
.tally-block-heading-2 h2 { font-size: var(--nl-form-section-size); font-weight: 600; letter-spacing: -.01em; color: var(--nl-text); }
/* Plain section headings (forms too short to collapse): extra space above */
.tally-block-heading-2:not([data-nl-sec]) { padding-top: 36px !important; margin-bottom: -12px !important; }
/* Free/plain sections: underline the title itself, then separate its fields.
   Member accordion headings already have their own bordered container. */
.tally-block-heading-2:not([data-nl-sec]) {
  padding-bottom: var(--nl-form-section-field-gap) !important;
  border-bottom: 0;
}
/* The rule under a plain section title spans the full form width */
.tally-block-heading-2:not([data-nl-sec]) { width: 100%; }
.tally-block-heading-2:not([data-nl-sec]) div:has(> h2) { width: 100%; }
.tally-block-heading-2:not([data-nl-sec]) h2 {
  width: 100%;
  margin-bottom: 0 !important;
  padding-bottom: var(--nl-form-section-title-gap) !important;
  border-bottom: var(--nl-form-section-rule-width) solid var(--nl-line);
}

/* Field label */
.tally-block-title h3, .tally-block-label { font-size: var(--nl-form-label-size) !important; line-height: 1.35 !important; font-weight: 500 !important; color: var(--nl-text); }
/* Hint: a text block directly under a field label */
.tally-block-title + .tally-block-text { margin-top: calc(var(--nl-form-hint-lift) * -1) !important; padding-bottom: var(--nl-form-hint-field-gap) !important; font-size: var(--nl-form-hint-size); line-height: 1.45; color: var(--nl-muted); }

/* Required: Tally's asterisk becomes the mint "Required" pill */
.tally-required-indicator { position: static !important; display: inline-flex !important; align-items: center; width: auto !important; height: auto !important; margin-left: 8px; font-size: 0 !important; color: transparent !important; background: transparent !important; box-shadow: none !important; }
.tally-required-indicator > * { display: none !important; }
.tally-required-indicator::after {
  content: "Required";
  display: inline-block; font-size: 11px; font-weight: 500; line-height: 1; white-space: nowrap;
  color: var(--nl-mint-text); background: var(--nl-mint-bg);
  border-radius: 999px; padding: 4px 8px; letter-spacing: 0;
}

/* ---------- Inputs (text, email, number, link, date, time, phone, dropdown, textarea) ---------- */
.tally-app div[class*=' tally-block-input'] input,
.tally-app .tally-block-dropdown input,
.tally-app .tally-block-textarea textarea,
.tally-app .tally-other-option-input {
  min-height: var(--nl-field-h);
  border: 1px solid var(--nl-border) !important;
  border-radius: var(--nl-radius) !important;
  background-color: var(--nl-surface) !important;
  color: var(--nl-text);
  font-size: 15px;
  box-shadow: none !important;
  transition: border-color .15s, box-shadow .15s;
}
.tally-app .tally-block-textarea textarea { min-height: 104px; line-height: 1.5; }
.tally-app input::placeholder, .tally-app textarea::placeholder { color: var(--nl-placeholder); opacity: var(--nl-form-placeholder-opacity); }
/* Examples read as quiet sample text: lighter, a touch smaller and airier */
.tally-app .tally-block-textarea textarea::placeholder { font-size: var(--nl-form-placeholder-size); line-height: 1.6; }
/* Tall text areas for fields with long answers: list each field's textarea block in the form's own custom CSS:
   .tally-block-<uuid> textarea { min-height: var(--nl-form-textarea-tall); } */

.tally-app div[class*=' tally-block-input'] input:hover,
.tally-app .tally-block-dropdown input:hover,
.tally-app .tally-block-textarea textarea:hover { border-color: var(--nl-border-hover) !important; }

.tally-app .tally-block input:focus,
.tally-app .tally-block input:focus-within,
.tally-app .tally-block textarea:focus,
.tally-app .tally-block textarea:focus-within {
  border-color: var(--nl-focus) !important;
  box-shadow: 0 0 0 3px var(--nl-ring) !important;
  outline: none;
}

/* ---------- Choices ---------- */
.tally-multiple-choice-option > div, .tally-checkbox > div { border-radius: var(--nl-radius); }
.tally-multiple-choice-option .tally-enumeration-badge { display: none; }
.tally-multiple-choice-option.tally-multiple-choice-option-selected > div,
.tally-multiple-choice-option.tally-multiple-choice-option-selected > div:focus-within {
  box-shadow: var(--nl-faint) 0 0 0 1px !important;
}
.tally-multiple-choice-option-selected > div > div > div { background-color: var(--nl-text); }
.tally-checkbox-selected > div > div > div { background-color: var(--nl-text); }
.tally-checkbox.tally-checkbox-selected > div > div > div,
.tally-checkbox.tally-checkbox-selected > div > div > div:focus-within { box-shadow: var(--nl-text) 0 0 0 1px !important; }

/* ---------- Validation ---------- */
.tally-validation-error { color: var(--nl-error) !important; font-size: 13px; }

/* ---------- Buttons ---------- */
.tally-submit-button { padding-top: var(--nl-form-submit-gap) !important; }
.tally-submit-button button {
  height: var(--nl-field-h); padding: 0 16px;
  background-color: var(--nl-text) !important; color: #fff !important;
  border: 0 !important; border-radius: var(--nl-radius) !important;
  font-size: 15px; font-weight: 600; box-shadow: none !important;
}
.tally-submit-button button:hover { background-color: #000 !important; }
.tally-submit-button button span { color: #fff !important; }
.tally-submit-button svg { color: var(--nl-green) !important; }
.tally-back-button { color: var(--nl-faint); }

/* ---------- Collapsible sections ----------
   nutt-labs-tally.js turns every Heading 2 into a section toggle and marks
   blocks with data-nl-* attributes. Without the script, headings render as
   plain headings and every field stays visible. */
[data-nl-sec] { border-left: 1px solid var(--nl-line); border-right: 1px solid var(--nl-line); padding-left: 20px !important; padding-right: 20px !important; }
[data-nl-sec][data-nl-hide] { display: none !important; }
[data-nl-sec="head"] {
  position: relative; display: flex; align-items: center; min-height: 60px;
  padding-right: 64px !important; border-top: 1px solid var(--nl-line);
  cursor: pointer; user-select: none; transition: background-color .15s;
}
[data-nl-sec="head"][data-nl-first] { border-top-color: var(--nl-line); border-top-left-radius: 12px; border-top-right-radius: 12px; margin-top: 24px !important; }
[data-nl-sec="head"]:hover { background-color: var(--nl-hover); }
[data-nl-sec="head"]:focus { outline: none; }
[data-nl-sec="head"]:focus-visible { box-shadow: none; background-color: var(--nl-hover); }
[data-nl-sec="head"] h2 { margin: 0 !important; padding: 0 !important; font-size: 17px !important; line-height: 24px !important; font-weight: 600 !important; letter-spacing: -.005em; }
[data-nl-sec="head"]::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 28px; height: 28px; margin-top: -14px;
  background: no-repeat center / 16px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23676e78' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 6.5 8 10l3.5-3.5'/%3E%3C/svg%3E");
  transition: transform .2s;
}
[data-nl-sec="head"][aria-expanded="true"]::after { transform: rotate(180deg); }
[data-nl-sec="head"][data-nl-meta]::before {
  content: attr(data-nl-meta); position: absolute; right: 56px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--nl-faint); white-space: nowrap;
}
[data-nl-sec="body"][data-nl-first-body] { padding-top: 4px !important; }
[data-nl-last] { border-bottom: 1px solid var(--nl-line); border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; padding-bottom: 14px !important; margin-bottom: 24px !important; }
[data-nl-sec="head"][data-nl-last] { padding-bottom: 0 !important; }
[data-nl-sec="head"][aria-expanded="false"][data-nl-last]:hover,
[data-nl-sec="head"][data-nl-last][aria-expanded="false"] { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }

/* ---------- Multi-page forms ---------- */
/* Progress bar: hairline track, dark fill for completed pages */
.tally-progress-bar-item { background-color: var(--nl-line) !important; height: 3px !important; }
.tally-progress-bar-item::after { background-color: var(--nl-text) !important; }
/* Back link: muted, darkens on hover, tucked into the page's top-left corner (top-right on phones, beside the logo) */
.tally-back-button { position: absolute; top: var(--nl-page-corner); left: var(--nl-page-corner); width: auto !important; z-index: 2; }
.tally-back-button button { color: var(--nl-muted) !important; }
.tally-back-button button:hover { color: var(--nl-text) !important; }
/* A page that opens with a section heading sits close under the Back link */
.tally-page .tally-block-heading-2:not([data-nl-sec]):first-child { padding-top: 8px !important; }

/* ---------- Phone ---------- */
@media (max-width: 576px) {
  .tally-back-button { top: 50px; left: auto; right: 16px; }
  .tally-block-form-title h1 { font-size: 30px; }
  .tally-app div[class*=' tally-block-input'] input,
  .tally-app .tally-block-dropdown input { min-height: 44px; font-size: 16px; }
  .tally-app .tally-block-textarea textarea { font-size: 16px; }
  .tally-submit-button button { height: 44px; width: 100%; }
  [data-nl-sec] { padding-left: 16px !important; padding-right: 16px !important; }
  [data-nl-sec="head"] { min-height: 56px; padding-right: 56px !important; }
  [data-nl-sec="head"]::after { right: 10px; }
  [data-nl-sec="head"][data-nl-meta]::before { right: 46px; }
}
