/* Calculator — light by default, dark when .dark on html; compact size */

.calc-toeic-wrapper {
  max-width: 960px;
  margin: 0 auto;
  overflow: visible;
}

/* ----- Light theme (default) ----- */
.calc-container {
  background: #f8fafc;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  padding: 18px;
  border: 1px solid #e2e8f0;
  overflow: visible;
}

.calc-header {
  text-align: center;
  margin-bottom: 16px;
}

.calc-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 6px 0;
}

.calc-subtitle {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

.calc-body {
  display: grid;
  gap: 16px;
  overflow: visible;
}
@media (min-width: 768px) {
  .calc-body {
    grid-template-columns: 1fr 300px;
    grid-template-rows: auto 1fr;
    align-items: start;
  }
  .calc-label-full {
    grid-column: 1 / -1;
  }
  .calc-main {
    grid-column: 1;
    grid-row: 2;
  }
  #calcSummary.calc-summary-panel {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    width: 300px;
    min-width: 300px;
  }
}

.calc-label {
  color: #64748b;
  font-weight: 600;
  font-size: 0.85rem;
  margin: 0 0 8px 0;
}

.calc-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

/* Card layout: vertical block with header, badge, meta */
.calc-option-btn {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 14px;
  font-size: 0.875rem;
  color: #334155;
  cursor: pointer;
  text-align: center;
  font-weight: 500;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  width: 100%;
  font-family: inherit;
}

.calc-option-btn:active {
  transform: scale(0.98);
}

.calc-option-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.calc-option-btn.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.calc-option-btn.selected .calc-option-badge {
  background: #2563eb;
  color: #fff;
}

/* Card header: vehicle type */
.calc-option-btn .calc-option-header {
  display: block;
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1.25;
  color: inherit;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
  min-width: 0;
}

/* Badge circle — only the badge turns blue when selected */
.calc-option-btn .calc-option-badge {
  width: 48px;
  min-width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}

.calc-option-btn.calc-option-btn--wide-code .calc-option-badge {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Meta block: International, price, validity */
.calc-option-btn .calc-option-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: auto;
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.calc-option-btn .calc-option-international {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.calc-option-btn .calc-option-price {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 2px;
  opacity: 1;
}

.calc-option-btn .calc-option-validity {
  display: block;
  font-size: 0.7rem;
  margin-top: 2px;
  opacity: 0.9;
  font-weight: 500;
}

.calc-hint-content {
  background: #fef3c7;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  color: #78350f;
  text-align: left;
  margin-bottom: 12px;
  border-left: 4px solid #f59e0b;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.calc-hint-content.hidden {
  display: none !important;
}

.calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.calc-actions.hidden {
  display: none !important;
}

.calc-btn {
  padding: 10px 16px;
  font-size: 0.875rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.calc-btn-primary {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.calc-btn-primary:hover {
  filter: brightness(1.08);
}

.calc-btn-whatsapp {
  background: #22c55e;
  color: #fff;
}

.calc-btn-whatsapp:hover {
  filter: brightness(1.08);
}

.calc-btn-icon {
  font-size: 1rem;
}

.calc-summary-panel {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  border: 2px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.calc-summary-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 12px 0;
}

.calc-summary-body {
  font-size: 0.8rem;
  color: #64748b;
  min-height: 20px;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  column-gap: 1rem;
  row-gap: 0.5rem;
  align-items: start;
}

.calc-summary-placeholder {
  margin: 0;
  color: #94a3b8;
  grid-column: 1 / -1;
}

.calc-summary-body .calc-summary-row {
  display: contents;
}

.calc-summary-body .calc-summary-row .calc-summary-label {
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: normal;
  hyphens: auto;
  padding-right: 0.75rem;
  line-height: 1.4;
}

.calc-summary-body .calc-summary-row .calc-summary-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  white-space: nowrap;
  line-height: 1.4;
  padding-top: 0.05em;
}

.calc-total-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.calc-total-block.hidden {
  display: none !important;
}

.calc-total-label {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0 0 2px 0;
}

.calc-total-amount {
  font-size: 1.4rem;
  font-weight: 700;
  color: #2563eb;
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.calc-container .hidden {
  display: none !important;
}
.dark .calc-container {
  background: #263238;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .calc-title {
  color: #e2e8f0;
}

.dark .calc-subtitle {
  color: #94a3b8;
}

.dark .calc-label {
  color: #94a3b8;
}

.dark .calc-option-btn {
  background: #37474f;
  border-color: #455a64;
  color: #e2e8f0;
}

.dark .calc-option-btn:hover {
  background: #455a64;
  border-color: #546e7a;
}

.dark .calc-option-btn.selected {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.25);
}

.dark .calc-option-btn .calc-option-badge {
  background: #455a64;
  color: #e2e8f0;
}

.dark .calc-option-btn.selected .calc-option-badge {
  background: #0ea5e9;
  color: #0f172a;
}

.dark .calc-hint-content {
  background: #422006;
  color: #fef3c7;
  border-left-color: #f59e0b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dark .calc-btn-primary {
  background: #0ea5e9;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.dark .calc-summary-panel {
  background: #37474f;
  border-color: #455a64;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dark .calc-summary-title {
  color: #e2e8f0;
}

.dark .calc-summary-body {
  color: #94a3b8;
}

.dark .calc-summary-placeholder {
  color: #64748b;
}

.dark .calc-total-block {
  border-top-color: #455a64;
}

.dark .calc-total-label {
  color: #94a3b8;
}

.dark .calc-total-amount {
  color: #0ea5e9;
}

/* Print */
@media print {
  body * { visibility: hidden; }
  #calcPrintArea, #calcPrintArea * { visibility: visible; }
  #calcPrintArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 1rem;
    background: white;
    color: #111;
  }
  .calc-print-header { margin-bottom: 1.5rem; }
  .calc-print-header h1 { font-size: 1.5rem; font-weight: 700; }
  .calc-print-footer { margin-top: 2rem; font-size: 0.75rem; color: #666; }
}
