/* Savings goal tracker — tool-specific styles. Relies on tokens from styles.css. */

.sg-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 640px;
  margin-inline: auto;
  box-shadow: var(--shadow-md);
}

.sg-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* Mode toggle as a small segmented control */
.sg-mode {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  background: var(--color-bg-alt);
}

.sg-mode legend {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.sg-mode__opt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  user-select: none;
}

.sg-mode__opt input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}

.sg-mode__opt:has(input:checked) {
  background: var(--color-bg-card);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.sg-mode__opt:has(input:focus-visible) {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.sg-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sg-field label {
  font-size: 0.9375rem;
  font-weight: 500;
}

.sg-field input[type="text"],
.sg-field input[type="month"] {
  padding: 0.6rem 0.7rem;
  font-size: 1rem;
  font-family: var(--font-body);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  color: var(--color-text);
}

.input-currency {
  position: relative;
}

.input-currency::before {
  content: '$';
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}

.input-currency input {
  padding-left: 1.5rem !important;
  width: 100%;
}

.input-pct {
  position: relative;
}

.input-pct::after {
  content: '%';
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}

.input-pct input {
  padding-right: 1.5rem !important;
  width: 100%;
}

/* Results */
.sg-results {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.sg-placeholder {
  color: var(--color-text-muted);
  text-align: center;
  margin: 0;
}

.sg-output:not([hidden]) { display: flex; flex-direction: column; gap: var(--space-md); }

.sg-headline {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
}

.sg-sub {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.sg-block__title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin: var(--space-md) 0 var(--space-xs);
}

.sg-whatifs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sg-whatifs li {
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.sg-catchup {
  background: rgba(31, 61, 43, 0.06);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin: var(--space-md) 0 0;
}

.sg-print {
  align-self: flex-start;
  margin-top: var(--space-md);
}

.sg-pivot { text-align: center; }
.sg-pivot p { max-width: 56ch; margin-inline: auto; }
.sg-pivot__cta { margin-top: var(--space-lg); }

.sg-learn-more {
  margin-top: var(--space-xl);
  padding: var(--space-md) var(--space-lg);
  background: rgba(122, 143, 106, 0.08);
  border-left: 3px solid var(--color-secondary);
  border-radius: var(--radius-md);
}
.sg-learn-more h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 var(--space-sm);
}
.sg-learn-more ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.sg-learn-more li {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  font-size: 0.9rem;
  line-height: 1.4;
}
.sg-learn-more__tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: rgba(31, 61, 43, 0.06);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
}
.sg-learn-more a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: rgba(196, 122, 90, 0.4);
  text-underline-offset: 2px;
}
.sg-learn-more a:hover { text-decoration-color: var(--color-accent); }
@media print { .sg-learn-more { display: none !important; } }

/* Print-only nodes are hidden on screen */
@media screen {
  .sg-print-header,
  .sg-print-summary,
  .sg-print-footer { display: none; }
}

/* Mobile */
@media (max-width: 480px) {
  .sg-card { padding: var(--space-lg) var(--space-md); }
}

/* PRINT view: a clean single-page plan */
@media print {
  .header,
  .nav,
  .skip-link,
  .footer,
  .sg-form,
  .sg-placeholder,
  .sg-print,
  .sg-pivot,
  .footer__cookie-btn,
  .cf_modal,
  .cf_modal_container { display: none !important; }

  body { background: #fff !important; color: #1a1a1a !important; }

  .learn-hero { display: none; }

  .sg-card {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: none !important;
  }

  .sg-results {
    margin: 0 !important;
    padding: 0 !important;
    border-top: 0 !important;
  }

  /* Brand header band: edge-to-edge Deep Forest with the Cream G-mark + wordmark */
  .sg-print-header {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    background: #1F3D2B !important;
    color: #E8DFC8 !important;
    padding: 0.2in 0.4in;
    margin: -0.75in -0.75in 0.35in -0.75in;
    border-bottom: 3px solid #C47A5A !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .sg-print-header__mark { flex-shrink: 0; }
  .sg-print-header__brand {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #E8DFC8 !important;
  }
  .sg-print-header__title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #E8DFC8 !important;
    font-weight: 400;
    font-size: 1rem;
    border-left: 1px solid rgba(232, 223, 200, 0.5);
    padding-left: 0.5rem;
    margin-left: 0.2rem;
  }

  /* Input summary */
  .sg-print-summary {
    display: block !important;
    margin: 0 0 0.3in;
    font-size: 0.95rem;
  }
  .sg-print-summary p { margin: 0.06in 0; color: #555; }
  .sg-print-summary strong {
    font-weight: 700;
    color: #1F3D2B;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Headline in Deep Forest, display font */
  .sg-headline {
    color: #1F3D2B !important;
    font-size: 1.3rem !important;
    font-family: 'Lora', Georgia, 'Times New Roman', serif !important;
    font-weight: 700 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .sg-sub { color: #444 !important; }

  /* What-ifs heading with Soft Clay underline */
  .sg-block__title {
    color: #1F3D2B !important;
    border-bottom: 1px solid #C47A5A;
    padding-bottom: 0.06in;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .sg-whatifs li { color: #1a1a1a !important; }

  /* Catch-up callout with Soft Clay accent */
  .sg-catchup {
    background: transparent !important;
    border-left: 3px solid #C47A5A !important;
    color: #1F3D2B !important;
    padding: 0.08in 0.18in !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Footer */
  .sg-print-footer {
    display: flex !important;
    justify-content: space-between;
    margin-top: 0.5in;
    padding-top: 0.08in;
    border-top: 2px solid #1F3D2B;
    font-size: 0.85rem;
    color: #555;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  @page { size: letter; margin: 0.75in; }
}
