/* retirement.css — shared styles for retirement prototype */
/* Lettuce token values: pine-950=#021f21 pine-900=#03292b pine-800=#00393d pine-700=#0f6167
   lettuce-500=#9fe963 gray-100=#f7fafc gray-500=#a0aec0 gray-600=#718096
   red-500=#f56565 yellow-500=#ecc94b */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  background: #021f21;
  color: #f7fafc;
  min-height: 100vh;
  padding: 40px 24px;
}

.card {
  max-width: 640px;
  margin: 0 auto;
  background: #03292b;
  border-radius: 16px;
  padding: 32px;
}

.card-title {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #9fe963;
  margin-bottom: 24px;
}

/* ---- Tab bar ---- */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #00393d;
  margin-bottom: 8px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  font-family: inherit;
  color: #718096;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s;
}

.tab-btn.active {
  color: #9fe963;
  border-bottom-color: #9fe963;
}

.tab-btn.locked {
  color: #4a5568;
  cursor: default;
  pointer-events: none;
}

.step-indicator {
  font-size: 12px;
  color: #718096;
  margin-bottom: 24px;
  margin-top: 8px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- Option cards (Plan tab) ---- */
.option-cards { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }

.option-card {
  border: 2px solid #00393d;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #021f21;
}

.option-card:hover { border-color: #718096; }

.option-card.selected {
  border-color: #9fe963;
  background: rgba(159, 233, 99, 0.05);
}

.option-card.carry-card.selected { border-color: #9fe963; }

.option-card h3 {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #f7fafc;
  margin-bottom: 6px;
}

.option-card p { font-size: 13px; color: #a0aec0; line-height: 1.5; }
.option-card .carry-cta { font-size: 13px; color: #9fe963; margin-top: 10px; display: inline-block; text-decoration: none; }
.option-card .carry-cta:hover { text-decoration: underline; }

.broker-field {
  margin-top: 12px;
  display: none;
}

.broker-field.visible { display: block; }

/* ---- Form elements ---- */
label.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a0aec0;
  margin-bottom: 8px;
}

input[type="text"], input[type="number"], input[type="date"] {
  width: 100%;
  background: #021f21;
  border: 1px solid #00393d;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  color: #f7fafc;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  -moz-appearance: textfield;
}

input[type="number"] { font-size: 22px; font-weight: 600; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }

input:focus { border-color: #9fe963; }

.amount-prefix {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 12px;
}

.amount-prefix::before {
  content: '$';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  font-weight: 600;
  color: #a0aec0;
  pointer-events: none;
  z-index: 1;
}

.amount-prefix input[type="number"] { padding-left: 30px; }

/* ---- Progress bar ---- */
.progress-wrap { margin: 0 0 8px; }

.progress-track {
  height: 6px;
  background: #00393d;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  background: #9fe963;
  border-radius: 3px;
  transition: width 0.2s, background 0.2s;
  max-width: 100%;
  min-width: 0%;
}

.progress-fill.warn { background: #ecc94b; }
.progress-fill.danger { background: #f56565; }

.progress-label { font-size: 12px; color: #718096; }
.progress-label.warn { color: #ecc94b; }
.progress-label.danger { color: #f56565; }

.progress-secondary { font-size: 12px; color: #718096; margin-top: 4px; }

/* ---- MBD callout ---- */
.mbd-callout {
  display: none;
  background: rgba(15, 97, 103, 0.25);
  border: 1px solid #0f6167;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 12px;
  gap: 12px;
  align-items: flex-start;
}

.mbd-callout.visible { display: flex; }

.mbd-callout input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; accent-color: #9fe963; }

.mbd-callout label {
  font-size: 14px;
  color: #f7fafc;
  cursor: pointer;
  line-height: 1.5;
}

.mbd-callout small { display: block; font-size: 12px; color: #a0aec0; margin-top: 2px; }

/* ---- Type select ---- */
.type-select-wrap { margin-bottom: 24px; }

.type-select-wrap select {
  width: 100%;
  background: #00393d;
  border: 1px solid #0f6167;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  color: #f7fafc;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23718096' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.type-select-wrap select:focus { border-color: #9fe963; }
.type-select-wrap select option { background: #021f21; }

.type-desc {
  font-size: 13px;
  color: #718096;
  margin-top: 8px;
  line-height: 1.5;
  min-height: 1.2em;
}

/* ---- Type pills (kept for reference) ---- */
.pill-group {
  display: flex;
  gap: 0;
  border: 1px solid #00393d;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}

.pill {
  flex: 1;
  background: none;
  border: none;
  border-right: 1px solid #00393d;
  padding: 14px 10px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}

.pill:last-child { border-right: none; }
.pill:hover { background: rgba(255,255,255,0.03); }
.pill.selected { background: rgba(159, 233, 99, 0.1); }

.pill strong { display: block; font-size: 14px; color: #a0aec0; margin-bottom: 4px; }
.pill.selected strong { color: #9fe963; }
.pill small { font-size: 11px; color: #4a5568; line-height: 1.4; display: block; }
.pill.selected small { color: #718096; }

/* ---- Breakdown buckets ---- */
.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #718096;
  margin-bottom: 12px;
  margin-top: 24px;
}

.section-label:first-child { margin-top: 0; }

.bucket-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }

.bucket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #021f21;
  border: 1px solid #00393d;
  border-radius: 10px;
  padding: 14px 16px;
}

.bucket-row.employer { border-color: #0f6167; }

.bucket-name { font-size: 14px; color: #f7fafc; }
.bucket-name small { display: block; font-size: 11px; color: #718096; margin-top: 2px; }
.bucket-amount { font-size: 16px; font-weight: 600; color: #9fe963; white-space: nowrap; margin-left: 16px; }
.bucket-amount.muted { color: #718096; font-size: 14px; font-weight: 400; }

.employer-note { font-size: 11px; color: #718096; margin-top: -4px; margin-bottom: 16px; }

.split-inputs-wrap { margin-bottom: 8px; }

.split-inputs {
  display: flex;
  gap: 12px;
}

.split-field { flex: 1; }
.split-field label { font-size: 12px; color: #a0aec0; display: block; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.split-field .amount-prefix::before { font-size: 16px; }
.split-field input[type="number"] { font-size: 16px !important; font-weight: 400 !important; }

/* ---- Setup instructions ---- */
.instructions-toggle {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  color: #9fe963;
  cursor: pointer;
  padding: 0;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.instructions-toggle:hover { opacity: 0.8; }

.instructions-body { display: none; margin-top: 14px; }
.instructions-body.open { display: block; }

.instructions-body ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.instructions-body li { font-size: 13px; color: #a0aec0; line-height: 1.6; }
.instructions-body li strong { color: #f7fafc; }

/* ---- Buttons ---- */
.btn-row { display: flex; justify-content: flex-end; margin-top: 24px; }

.btn-primary {
  background: #9fe963;
  color: #021f21;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
  text-decoration: none;
}

.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.35; cursor: default; }

.btn-secondary {
  background: none;
  border: 1px solid #00393d;
  color: #a0aec0;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
}

.btn-secondary:hover { border-color: #718096; }

/* ---- Success state ---- */
.save-success {
  display: none;
  text-align: center;
  padding: 32px 0 16px;
}

.save-success.visible { display: block; }
.save-success .checkmark { font-size: 48px; margin-bottom: 14px; color: #9fe963; }
.save-success p { color: #a0aec0; margin-bottom: 24px; font-size: 15px; }

/* ---- Tracking: Election banner ---- */
.election-banner {
  background: #021f21;
  border: 1px solid #0f6167;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.election-meta { display: flex; flex-direction: column; gap: 4px; }
.election-amount { font-size: 20px; font-weight: 700; color: #9fe963; }
.election-details { font-size: 13px; color: #a0aec0; }
.edit-link { font-size: 13px; color: #9fe963; text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.edit-link:hover { text-decoration: underline; }

.no-election-banner {
  background: #021f21;
  border: 1px solid #00393d;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin-bottom: 28px;
}

.no-election-banner p { color: #718096; font-size: 14px; margin-bottom: 12px; }
.no-election-banner a { color: #9fe963; text-decoration: none; font-size: 14px; font-weight: 600; }
.no-election-banner a:hover { text-decoration: underline; }

/* ---- Tracking: Section header ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #f7fafc;
}

.badge {
  background: #0f2a2c;
  color: #a0aec0;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  padding: 2px 9px;
  border: 1px solid #0f6167;
}

.badge.warn { background: #2d2006; color: #ecc94b; border-color: #744210; }
.badge.danger { background: #2d0a0a; color: #f56565; border-color: #742a2a; }

/* ---- Tracking: Actuals rows ---- */
.actuals-section { margin-bottom: 4px; }

.actuals-row {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #00393d;
}

.actuals-row:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.actuals-row-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.actuals-label { font-size: 13px; color: #a0aec0; }
.actuals-amount { font-size: 17px; font-weight: 700; color: #f7fafc; }
.actuals-projected { font-size: 11px; color: #718096; margin-top: 6px; }
.actuals-warn { color: #ecc94b; }
.actuals-danger { color: #f56565; }

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #00393d;
}

.total-label { font-size: 13px; color: #a0aec0; }
.total-amount { font-size: 16px; font-weight: 600; color: #f7fafc; }
.total-sub { font-size: 12px; font-weight: 400; color: #718096; }

/* ---- Tracking: Unlabeled transactions ---- */
.tx-section { margin-bottom: 4px; }
.empty-state { font-size: 13px; color: #718096; padding: 12px 0; }

.tx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #00393d;
  transition: opacity 0.3s;
}

.tx-row.fading { opacity: 0; }
.tx-row:last-child { border-bottom: none; }

.tx-info { flex: 1; min-width: 0; }
.tx-desc { font-size: 14px; color: #f7fafc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-date { font-size: 11px; color: #718096; margin-top: 2px; }
.tx-amount { font-size: 14px; font-weight: 600; color: #f7fafc; white-space: nowrap; }

.tx-labels { display: flex; gap: 6px; flex-shrink: 0; }

.tx-btn {
  background: none;
  border: 1px solid #00393d;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-family: inherit;
  color: #718096;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.tx-btn:hover { border-color: #9fe963; color: #9fe963; }
.tx-btn.employer:hover { border-color: #4fd1c5; color: #4fd1c5; }
.tx-btn.not-retirement:hover { border-color: #4a5568; color: #718096; }

/* ---- Tracking: Off-Lettuce ---- */
.offlettuce-section { margin-bottom: 4px; }

.collapse-toggle {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  color: #a0aec0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
}

.collapse-toggle:hover { color: #f7fafc; }

.collapse-body { display: none; margin-top: 16px; }
.collapse-body.open { display: block; }

.offlettuce-list { margin-bottom: 16px; }

.ol-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #00393d;
  gap: 12px;
}

.ol-entry:last-child { border-bottom: none; }
.ol-meta { font-size: 12px; color: #a0aec0; flex: 1; }
.ol-amount { font-size: 14px; font-weight: 600; color: #f7fafc; white-space: nowrap; }
.ol-remove { background: none; border: none; color: #4a5568; cursor: pointer; font-size: 18px; padding: 0 4px; line-height: 1; }
.ol-remove:hover { color: #f56565; }

.offlettuce-form { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: flex; gap: 12px; }
.form-field { flex: 1; }
.form-field label { display: block; font-size: 11px; color: #a0aec0; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; font-weight: 600; }

.form-field input[type="text"],
.form-field input[type="number"],
.form-field input[type="date"] {
  font-size: 14px !important;
  padding: 10px 12px !important;
}

.form-field select {
  width: 100%;
  background: #021f21;
  border: 1px solid #00393d;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: #f7fafc;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.form-field select:focus { border-color: #9fe963; }
.form-field select option { background: #021f21; }

/* ---- Divider ---- */
.section-divider {
  border: none;
  border-top: 1px solid #00393d;
  margin: 8px 0 28px;
}

/* ---- Page navigation (election two-page flow) ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #718096;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  margin-bottom: 20px;
}

.back-link:hover { color: #a0aec0; }

.plan-badge {
  display: inline-block;
  background: #021f21;
  border: 1px solid #0f6167;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  color: #a0aec0;
  margin-bottom: 24px;
}

.page-question {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #f7fafc;
  margin-bottom: 20px;
}

/* ---- Range slider ---- */
input[type="range"] {
  width: 100%;
  height: 4px;
  background: #00393d;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  margin: 10px 0 4px;
  border: none;
  padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: #9fe963;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(159, 233, 99, 0.15);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #9fe963;
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

input[type="range"]:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(159, 233, 99, 0.25);
}

/* ---- Amount section (short input + slider) ---- */
.amount-section { margin-bottom: 20px; }

.amount-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.amount-header label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #a0aec0; }

.amount-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.amount-input-wrap .dollar-sign {
  font-size: 20px;
  font-weight: 700;
  color: #a0aec0;
  line-height: 1;
}

input.amount-short {
  width: 110px !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  padding: 6px 8px !important;
  text-align: right;
}

.limit-row {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  margin-top: 4px;
}

.limit-text { font-size: 12px; color: #718096; }

.help-btn {
  width: 16px;
  height: 16px;
  min-width: 16px;
  background: #021f21;
  border: 1px solid #0f6167;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: #a0aec0;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.help-btn:hover { background: #0f2a2c; color: #f7fafc; }

.help-popup {
  display: none;
  position: absolute;
  left: 0;
  top: 24px;
  background: #03292b;
  border: 1px solid #0f6167;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
  color: #a0aec0;
  line-height: 1.7;
  z-index: 20;
  width: 260px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.help-popup.open { display: block; }
.help-popup strong { color: #f7fafc; display: block; }
.help-popup .help-row { display: flex; justify-content: space-between; gap: 12px; }
.help-popup .help-divider { border: none; border-top: 1px solid #00393d; margin: 6px 0; }
.help-popup .help-total { color: #9fe963; font-weight: 600; }

/* ---- Breakdown buckets (uniform) ---- */
.breakdown-bucket {
  background: #021f21;
  border: 1px solid #00393d;
  border-radius: 10px;
  padding: 14px 16px;
}

.bucket-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 12px;
}

.bucket-label-wrap { flex: 1; }
.bucket-label { font-size: 13px; color: #f7fafc; font-weight: 500; }
.bucket-sub { font-size: 11px; color: #718096; margin-top: 2px; }

.bucket-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.bucket-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.bucket-input-wrap .dollar-sign { font-size: 13px; color: #718096; }

input.bucket-input {
  width: 86px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  padding: 5px 8px !important;
  text-align: right;
}

.auto-btn {
  background: none;
  border: 1px solid #0f6167;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11px;
  font-family: inherit;
  color: #4fd1c5;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.auto-btn:hover { background: rgba(15, 97, 103, 0.2); }

.bucket-limit-note { font-size: 10px; color: #4a5568; margin-top: 2px; text-align: right; }

/* ---- Breakdown total row ---- */
.breakdown-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #00393d;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 4px;
  font-size: 13px;
  transition: border-color 0.2s;
}

.breakdown-total-row.ok { border-color: #0f6167; }
.breakdown-total-row.over { border-color: #f56565; }
.breakdown-total-row.under { border-color: #ecc94b; }

.breakdown-total-label { color: #718096; }
.breakdown-total-value { font-weight: 600; color: #f7fafc; }
.breakdown-total-value.ok { color: #9fe963; }
.breakdown-total-value.over { color: #f56565; }
.breakdown-total-value.under { color: #ecc94b; }

.breakdown-mismatch-note { font-size: 11px; margin-top: 6px; }
.breakdown-mismatch-note.over { color: #f56565; }
.breakdown-mismatch-note.under { color: #ecc94b; }

.breakdown-tip { font-size: 12px; color: #a0aec0; margin-top: 0; margin-bottom: 12px; line-height: 1.4; }
