/* ======================================================
  CLS ADVISOR TOOL — CONSOLIDATED STYLES
  (No duplicates, scoped, production-friendly)
====================================================== */

[x-cloak] {
  display: none !important;
}

/* ======================================================
  TOOL CONTAINER + TYPOGRAPHY
====================================================== */
.cls-advisor-tool {
  width: 100%;
  max-width: none;
  /* parent/theme controls width */
  margin: 0;
  border: 1px solid #ddd;
  padding: 2rem;
  border-radius: 8px;
  box-sizing: border-box;

  /* vertical rhythm scale */
  --cls-space-1: 0.5rem;
  /* 8px */
  --cls-space-2: 1rem;
  /* 16px */
  --cls-space-3: 1.5rem;
  /* 24px */
}

/* Intro paragraph(s) inside the tool (safe + scoped) */
.cls-advisor-tool>p {
  font-size: 1.05rem;
  /* ~16.8px */
  line-height: 1.6;
  margin: 0 0 var(--cls-space-2) 0;
}

/* General paragraph rhythm inside tool (keeps things readable) */
.cls-advisor-tool p {
  line-height: 1.6;
}

/* ======================================================
  FORM GRID — DESKTOP/TABLET/MOBILE
====================================================== */
.cls-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem 1.5rem;
  align-items: end;
}

@media (max-width: 1024px) {
  .cls-form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .cls-advisor-tool {
    padding: 1rem;
    border-radius: 6px;
  }

  .cls-form-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem 0.9rem;
  }
}

.cls-form-break {
  grid-column: 1 / -1;
  height: 0;
}

/* ======================================================
  FIELDS
====================================================== */
.cls-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cls-field label {
  display: block;
  font-size: 1rem;
  /* 16px */
  font-weight: 500;
  color: #222;
  margin: 0;
}

.cls-field input,
.cls-field select {
  width: 100%;
  padding: 0.45rem 0.5rem;
  font-size: 1rem;
  /* 16px */
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

@media (max-width: 600px) {

  .cls-field input,
  .cls-field select {
    padding: 0.55rem 0.6rem;
    font-size: 1.02rem;
  }
}

/* Optional input prefix pattern (kept) */
.cls-input-prefix {
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
}

.cls-input-prefix span {
  background: #f7f7f7;
  padding: 0.45rem 0.6rem;
  border-right: 1px solid #ddd;
  font-size: 0.95rem;
}

.cls-input-prefix input {
  border: none !important;
  padding: 0.45rem 0.5rem;
  flex: 1;
  box-sizing: border-box;
}

/* ======================================================
  STEP HEADERS (Hierarchy + Rhythm)
====================================================== */
.cls-step {
  margin-top: var(--cls-space-3);
}

.cls-step-heading {
  font-size: 1.15rem;
  /* ~18.4px */
  font-weight: 600;
  margin: 0 0 var(--cls-space-1) 0;
}

.cls-step-subtitle {
  font-size: 1rem;
  /* 16px */
  line-height: 1.55;
  color: #555;
  margin: 0 0 var(--cls-space-2) 0;
}

.cls-step-indicator {
  margin-bottom: var(--cls-space-1);
}

/* ======================================================
  ERRORS
====================================================== */
.cls-error {
  color: #b00020;
  font-size: 0.9rem;
  margin: 0.25rem 0 0 0;
}

/* ======================================================
  ACTIONS (layout only — button look handled below)
====================================================== */
.cls-actions {
  margin-top: var(--cls-space-2);
}

/* ======================================================
  RESULT CARDS + OUTPUT FORMATTING
====================================================== */
.cls-result {
  margin-top: var(--cls-space-3);
  padding: 1.25rem;
  border-radius: 10px;
  background: #fafafa;
  border: 1px solid #eee;
}

.cls-result h4 {
  font-size: 1.15rem;
  /* ~18–19px */
  font-weight: 650;
  margin: 0;
  color: #111;
}

/* Header row: title + badge */
.cls-result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

/* Paragraphs inside cards */
.cls-result p {
  margin: 0 0 0.75rem 0;
  line-height: 1.65;
  color: #333;
}

.cls-result p:last-of-type {
  margin-bottom: 0;
}

/* Notes block */
.cls-notes-preline {
  white-space: pre-line;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin: 0.75rem 0 0.9rem 0;
  line-height: 1.65;
  color: #333;
}

/* Disclaimer styling */
.cls-disclaimer {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #666;
  margin-top: 0.9rem;
}

/* Badge */
.cls-badge {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #e9f5f4;
  color: #0d5f5b;
  border: 1px solid #cfe8e6;
  white-space: nowrap;
}

.cls-badge--detail {
  background: #eef2ff;
  border-color: #d7ddff;
  color: #2a3a8b;
}

/* Range highlight row */
.cls-range {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin: 0.25rem 0 0.9rem 0;
}

.cls-range-label {
  font-size: 0.9rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cls-range-amt {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111;
}

.cls-range-sep {
  color: #888;
}

@media (max-width: 600px) {
  .cls-result {
    padding: 1rem;
  }

  .cls-notes-preline {
    padding: 0.8rem 0.9rem;
  }

  .cls-range-amt {
    font-size: 1.15rem;
  }
}

/* ======================================================
  BUTTONS — MATCH YOUR SITE (GF) STYLE
  IMPORTANT: scoped to .cls-actions so it won't style random buttons
====================================================== */
.cls-advisor-tool .cls-actions button {
  padding: 10px 20px;
  border: 0;
  background-color: #107772;
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s ease;
  font-size: 1.2rem;
  display: inline-block;
  text-transform: uppercase;
  font-family: 'Work Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  cursor: pointer;
  line-height: normal !important;
}

.cls-advisor-tool .cls-actions button:hover {
  background-color: #0d5f5b !important;
}

.cls-advisor-tool .cls-actions button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Secondary button (e.g., "Cancel", "Submit another case" if you want it grey) */
.cls-advisor-tool .cls-actions .cls-btn-secondary {
  background-color: #A1A1A1 !important;
}

.cls-advisor-tool .cls-actions .cls-btn-secondary:hover {
  background-color: #6E6E6E !important;
}

@media (max-width: 600px) {
  .cls-advisor-tool .cls-actions button {
    width: 100%;
    display: block;
  }
}

/* ======================================================
  MODAL OVERLAY (container only — inner card is inline-styled in HTML)
====================================================== */
.cls-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 9999;
}
/* Rounded shell clips everything (including scrollbar) */
.cls-modal-card{
  margin-top: 3rem;
  background:#fff;
  width:min(560px, 100%);
  max-height:85vh;
  border-radius:10px;
  box-shadow:0 10px 30px rgba(0,0,0,0.20);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

/* Inner scroller */
.cls-modal-scroll{
  overflow-y:auto;
  padding:1.25rem;
  scrollbar-gutter: stable;
}


/* --- Prevent layout shift when errors appear --- */

/* Reserve a consistent area at the bottom of each field for error text */
.cls-field {
  --error-space: 18px;
  /* ~1 line. Try 22px if your font is bigger */
  position: relative;
  padding-bottom: var(--error-space);
}

/* Make the error text sit in the reserved space (doesn't push layout) */
.cls-error {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  font-size: 0.875rem;
  /* optional */
  line-height: 1.2;
}

/* If you have labels with margin-bottom, keep them stable too */
.cls-field label {
  display: block;
}

/* Optional: keep inputs/selects aligned nicely across columns */
.cls-field input,
.cls-field select {
  width: 100%;
  box-sizing: border-box;
}