/* =============================================
   UPFRONT COST CALCULATOR
   ============================================= */

/* ---------- presets ---------- */
.k-presets { margin-bottom: 2rem; text-align: center; }
.k-presets-label {
  display: block;
  margin-bottom: 0.85rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8A6A2A;
}
.k-preset-chips { display: flex; flex-wrap: wrap; gap: 0.55rem; justify-content: center; }
.k-chip {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: #5C3A02;
  background: rgba(255,209,0,0.10);
  border: 1px solid rgba(180,124,0,0.38);
  border-radius: 100px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), transform var(--t), color var(--t);
}
.k-chip:hover { background: rgba(255,209,0,0.22); border-color: #B47C00; transform: translateY(-2px); }
.k-chip.active {
  background: linear-gradient(150deg, #F7CE2A, #D4A500);
  border-color: #C99A02;
  color: #1A0D02;
}
.k-chip:focus-visible { outline: 2px solid #B47C00; outline-offset: 3px; }

/* ---------- layout ---------- */
.k-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 1.25rem;
  align-items: start;
}
.k-panel {
  border-radius: 18px;
  padding: 1.9rem 1.75rem;
  border: 1px solid rgba(212,165,0,0.34);
  background: linear-gradient(150deg, rgba(255,253,247,0.96), rgba(253,244,227,0.92));
  box-shadow: 0 10px 30px rgba(60,30,5,0.09);
}

/* ---------- inputs ---------- */
.k-field { margin-bottom: 1.15rem; }
.k-field label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6B4A12;
}
.k-field input,
.k-field select {
  width: 100%;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1B0E03;
  background: #FFFDF7;
  border: 1px solid rgba(120,70,0,0.28);
  border-radius: 10px;
  padding: 0.78rem 0.9rem;
  transition: border-color var(--t), box-shadow var(--t);
}
.k-field input:focus,
.k-field select:focus {
  outline: none;
  border-color: #B47C00;
  box-shadow: 0 0 0 3px rgba(255,209,0,0.22);
}

.k-toggle {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.9rem 0;
  cursor: pointer;
  border-top: 1px solid rgba(120,70,0,0.12);
}
.k-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.k-toggle-box {
  flex-shrink: 0;
  width: 22px; height: 22px;
  margin-top: 2px;
  border-radius: 6px;
  border: 1.5px solid rgba(120,70,0,0.40);
  background: #FFFDF7;
  position: relative;
  transition: background var(--t), border-color var(--t);
}
.k-toggle-box::after {
  content: '';
  position: absolute;
  left: 6px; top: 2px;
  width: 6px; height: 11px;
  border: solid #1A0D02;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.25s cubic-bezier(.2,.8,.3,1);
}
.k-toggle input:checked + .k-toggle-box {
  background: linear-gradient(150deg, #F7CE2A, #D4A500);
  border-color: #C99A02;
}
.k-toggle input:checked + .k-toggle-box::after { transform: rotate(45deg) scale(1); }
.k-toggle input:focus-visible + .k-toggle-box { box-shadow: 0 0 0 3px rgba(255,209,0,0.35); }
.k-toggle-text strong {
  display: block;
  font-size: 0.9rem;
  color: #1B0E03;
  margin-bottom: 0.2rem;
}
.k-toggle-text small {
  display: block;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #6B4A12;
}

.k-note {
  margin-top: 0.8rem;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  background: rgba(200,120,20,0.10);
  border: 1px solid rgba(200,120,20,0.32);
  font-size: 0.79rem;
  line-height: 1.55;
  font-weight: 600;
  color: #7A4A0C;
}
.k-note[hidden] { display: none; }

/* ---------- results ---------- */
.k-results { background: linear-gradient(155deg, #FFF8E4, #FBEFD3); }
.k-total-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8A6A2A;
}
.k-total {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3.1rem);
  font-weight: 700;
  line-height: 1.1;
  color: #1B0E03;
  margin: 0.35rem 0 0.25rem;
  letter-spacing: -0.02em;
}
.k-total-sub {
  font-size: 0.8rem;
  color: #6B4A12;
  margin-bottom: 1.4rem;
}

.k-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.k-table th {
  text-align: left;
  font-weight: 600;
  color: #3A2408;
  padding: 0.72rem 0;
  border-bottom: 1px solid rgba(120,70,0,0.12);
}
.k-table td {
  text-align: right;
  font-weight: 700;
  color: #1B0E03;
  padding: 0.72rem 0;
  border-bottom: 1px solid rgba(120,70,0,0.12);
  white-space: nowrap;
}
.k-row-off th { color: #8A6A2A; }
.k-struck { text-decoration: line-through; color: #A08A5A !important; font-weight: 600 !important; }
.k-tag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.12rem 0.45rem;
  border-radius: 100px;
  background: rgba(60,140,80,0.14);
  border: 1px solid rgba(60,140,80,0.38);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #2E6B44;
  vertical-align: middle;
}

.k-saving {
  margin-top: 1.3rem;
  padding: 0.95rem 1.1rem;
  border-radius: 12px;
  background: rgba(60,140,80,0.10);
  border: 1px solid rgba(60,140,80,0.30);
  font-size: 0.88rem;
  line-height: 1.6;
  color: #24583A;
}
.k-saving[hidden] { display: none; }
.k-saving strong { color: #1B4A2E; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .k-grid { grid-template-columns: 1fr; }
  .k-panel { padding: 1.5rem 1.25rem; }
  .k-preset-chips { justify-content: flex-start; }
  .k-presets { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .k-chip, .k-toggle-box, .k-toggle-box::after { transition: none; }
}
