/* =============================================================================
   CSS CUSTOM PROPERTIES — Donohue Wealth Management Brand
   ============================================================================= */
:root {
  color-scheme: light;

  --warm-gray:   #c9c0c0;
  --cream:       #ffffff;
  --charcoal:    #343434;
  --slate-blue:  #9fafbb;
  --warm-tan:    #d8b28f;
  --forest-green:#2f4b34;

  --card-bg:     #ffffff;
  --card-border: rgba(201,192,192,0.45);
  --input-border:#c9c0c0;
  --input-focus: #9fafbb;
  --error-color: #a33;
  --radius:      6px;
  --shadow:      0 1px 4px rgba(52,52,52,0.08);
}

/* =============================================================================
   RESET & BASE
   ============================================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: #faf9f5;
  color: #343434;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #faf9f5;
  color: var(--charcoal);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: "EB Garamond", Georgia, serif;
  font-weight: 400;
  line-height: 1.25;
  color: var(--charcoal);
}

/* =============================================================================
   HEADER
   ============================================================================= */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #dedad3;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.site-title {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--charcoal);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.site-subtitle {
  font-size: 0.69rem;
  color: #9a948e;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.header-right {
  display: flex;
  align-items: center;
}

.schedule-btn {
  display: inline-block;
  font-size: 0.81rem;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 5px;
  background: var(--forest-green);
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.schedule-btn:hover {
  background: #1e3220;
  box-shadow: 0 3px 8px rgba(0,0,0,0.18);
}

/* =============================================================================
   DISCLOSURE BANNER (above form)
   ============================================================================= */
.disclosure-banner {
  background: rgba(159,175,187,0.15);
  border-left: 3px solid var(--slate-blue);
  padding: 0.85rem 1.25rem;
  font-size: 0.82rem;
  color: var(--charcoal);
  line-height: 1.55;
}

/* =============================================================================
   LAYOUT
   ============================================================================= */
.app-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 2rem;
}

.app-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 2rem;
  align-items: start;
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  .app-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   FORM PANEL
   ============================================================================= */
.form-panel { display: flex; flex-direction: column; gap: 1rem; }

.form-panel h2 {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}

.form-panel .subtitle {
  font-size: 0.84rem;
  color: #666;
  margin-bottom: 0.5rem;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 1.05rem;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  color: var(--charcoal);
}

.card .dollars-note {
  font-size: 0.76rem;
  color: #888;
  margin-bottom: 0.75rem;
  font-style: italic;
}

/* Field rows */
.field-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.85rem;
}

.field-row:last-child { margin-bottom: 0; }

.field-row label {
  font-size: 0.82rem;
  color: #555;
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.field-row input,
.field-row select {
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--charcoal);
  background: #fff;
  transition: border-color 0.15s;
  width: 100%;
}

.field-row input:focus,
.field-row select:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(159,175,187,0.2);
}

.field-row .field-hint {
  font-size: 0.73rem;
  color: #999;
  margin-top: 0.2rem;
}

/* Two-column mini-grid inside cards */
.field-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

/* Error banner */
.error-banner {
  background: #fdecea;
  border: 1px solid #e8b4b0;
  color: var(--error-color);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
}

/* Calculate button */
.calculate-btn {
  width: 100%;
  padding: 0.6rem 1rem;
  background: var(--forest-green);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: "EB Garamond", Georgia, serif;
  font-size: 0.95rem;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.2s;
  margin-top: 0.75rem;
}

.calculate-btn:hover { background: #223a27; }
.calculate-btn:active { background: #1a2d1f; }

/* =============================================================================
   RESULTS PANEL
   ============================================================================= */
.results-panel { display: flex; flex-direction: column; gap: 1.5rem; }

/* Summary stats */
.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 600px) {
  .summary-stats { grid-template-columns: 1fr; }
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}

.stat-card .stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #888;
  margin-bottom: 0.3rem;
}

.stat-card .stat-value {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.55rem;
  color: var(--charcoal);
  line-height: 1.2;
}

/* Chart container */
.chart-container {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 0.75rem;
  box-shadow: var(--shadow);
  position: relative;
  height: 340px;
}

/* Chart footnote */
.chart-footnote {
  font-size: 0.68rem;
  color: #b0a9a3;
  line-height: 1.45;
  font-style: italic;
  margin-top: -0.5rem;
}

/* Table toggle button */
.toggle-btn {
  background: transparent;
  border: 1px solid var(--slate-blue);
  color: var(--charcoal);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.15s;
}

.toggle-btn:hover { background: rgba(159,175,187,0.15); }

/* Table */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

#projection-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.79rem;
  white-space: nowrap;
}

#projection-table thead th {
  background: var(--charcoal);
  color: var(--cream);
  font-weight: 500;
  padding: 0.6rem 0.75rem;
  text-align: right;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  position: sticky;
  top: 0;
}

#projection-table thead th:first-child { text-align: left; }

#projection-table thead th.group-header {
  background: #1e3a5f;
  text-align: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.7rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

#projection-table tbody tr { border-bottom: 1px solid rgba(201,192,192,0.3); }
#projection-table tbody tr:last-child { border-bottom: none; }
#projection-table tbody tr:nth-child(even) { background: rgba(201,192,192,0.07); }
#projection-table tbody tr:hover { background: rgba(159,175,187,0.12); }

#projection-table tbody td {
  padding: 0.45rem 0.75rem;
  text-align: right;
  color: var(--charcoal);
}

#projection-table tbody td:first-child { text-align: left; font-weight: 500; }

#projection-table .col-total { font-weight: 600; }
#projection-table .col-cum   { color: #555; }

/* Assumptions block */
.assumptions-block {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  font-size: 0.83rem;
}

.assumptions-block h4 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
}

.assumptions-block ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.assumptions-block li { color: #555; line-height: 1.5; }
.assumptions-block li strong { color: var(--charcoal); }

/* Disclosure modal body content spacing */
.modal-body > .disc-section:first-child { margin-top: 24px; }
.modal-body .disc-section + .disc-section { margin-top: 24px; }

.disc-section h4 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1e3a5f;
  margin-bottom: 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--card-border);
}

.disc-item {
  margin-bottom: 0.85rem;
  font-size: 0.82rem;
  color: #555;
  line-height: 1.6;
}

.disc-item:last-child { margin-bottom: 0; }

.disc-item strong {
  color: var(--charcoal);
  display: block;
  margin-bottom: 0.2rem;
}

.disc-item a, .disc-section ul li a {
  color: var(--slate-blue);
  text-decoration: none;
  border-bottom: 1px dotted var(--slate-blue);
  transition: color 0.15s, border-color 0.15s;
}

.disc-item a:hover, .disc-section ul li a:hover {
  color: var(--forest-green);
  border-bottom-color: var(--forest-green);
}

.disc-section ul {
  list-style: disc;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.disc-section ul li {
  font-size: 0.82rem;
  color: #555;
  line-height: 1.6;
}

.disclosure-results {
  border-top: 1px solid var(--card-border);
  padding-top: 1.25rem;
}

.disclosure-results h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #888;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.disclosure-results ul {
  list-style: disc;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.disclosure-results li {
  font-size: 0.78rem;
  color: #888;
  line-height: 1.5;
}

/* =============================================================================
   FOOTER
   ============================================================================= */
.site-footer {
  padding: 6px 20px;
  border-top: 1px solid #e8e4dc;
  background: #faf9f5;
  flex-shrink: 0;
  height: 54px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  height: 100%;
}

.footer-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.footer-disclosure {
  font-size: 0.6rem;
  color: #a8a39d;
  line-height: 1.45;
}

.footer-disc-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.6rem;
  color: #9fafbb;
  font-family: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
}

.footer-hypothetical {
  font-size: 0.6rem;
  color: #a8a39d;
  line-height: 1.45;
  margin-top: 2px;
}

.footer-attribution {
  font-size: 0.6rem;
  color: #a8a39d;
  margin-top: 2px;
}

.footer-logo {
  height: calc(100% - 10px);
  width: auto;
  opacity: 0.85;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
  align-self: flex-end;
  margin-bottom: 4px;
}

/* =============================================================================
   DISCLOSURE MODAL
   ============================================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow-y: auto;
}

.modal-overlay[hidden] { display: none !important; }

.modal-panel {
  background: #ffffff;
  border-radius: 10px;
  width: 100%;
  max-width: 900px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 64px);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #dedad3;
  flex-shrink: 0;
}

.modal-title {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--charcoal);
  letter-spacing: -0.01em;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: #6b6560;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 3px;
  transition: background 0.12s;
}

.modal-close:hover { background: rgba(0,0,0,0.06); }

.modal-body {
  overflow-y: auto;
  padding: 0 24px 24px;
  flex: 1;
}

/* =============================================================================
   UTILITY
   ============================================================================= */
[hidden] { display: none !important; }
