
/* 기본 컨테이너 및 반응형 레이아웃 */
.calc-page-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
  box-sizing: border-box;
}

.calc-header {
  margin-bottom: 2rem;
  text-align: left;
}

.calc-main-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-dark, #0F172A);
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.02em;
}

.calc-sub-desc {
  font-size: 1rem;
  color: var(--text-muted, #64748B);
  margin: 0;
}

/* 프리셋 업종 선택 영역 */
.calc-preset-section {
  margin-bottom: 2rem;
}

.preset-badge-guide {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--blue-2, #2563EB);
  margin-bottom: 0.75rem;
}

.preset-btn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
}

@media (min-width: 640px) {
  .preset-btn-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .preset-btn-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.preset-btn {
  min-height: 48px;
  background-color: #FFFFFF;
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.preset-btn:hover {
  border-color: var(--blue-2, #2563EB);
  background-color: #F8FAFC;
}

.preset-btn.is-active {
  border-color: var(--blue-2, #2563EB);
  background-color: #EFF6FF;
  box-shadow: 0 0 0 1px var(--blue-2, #2563EB);
}

.preset-btn-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.2;
}

.preset-btn-example {
  font-size: 0.75rem;
  color: #64748B;
  margin-top: 0.25rem;
  line-height: 1.2;
}

/* 2열 레이아웃: 입력 폼 vs 결과 사이드바 */
.calc-layout-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
}

@media (min-width: 1024px) {
  .calc-layout-grid {
    flex-direction: row;
  }
}

.calc-form-column {
  width: 100%;
  flex: 1 1 auto;
}

.calc-summary-column {
  width: 100%;
}

@media (min-width: 1024px) {
  .calc-summary-column {
    width: 380px;
    flex-shrink: 0;
    position: sticky;
    top: 1.5rem;
  }
}

/* 카드 공통 스타일 (밝은 바탕 #FFFFFF, 글자 #0F172A) */
.calc-card {
  background-color: #FFFFFF;
  color: #0F172A;
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

.calc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid #F1F5F9;
  margin-bottom: 1rem;
}

.calc-card-title-wrap {
  display: flex;
  align-items: center;
}

.calc-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0F172A;
  margin-left: 0.625rem;
}

.calc-card-title-static {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0F172A;
}

.calc-card-status {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--blue-2, #2563EB);
  background-color: #EFF6FF;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.badge-consult {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #D97706;
  background-color: #FEF3C7;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* 폼 요소 및 레이블 */
.form-row {
  margin-bottom: 1rem;
}

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

.field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.375rem;
}

.field-split-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.375rem;
}

.counter-display {
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue-2, #2563EB);
}

.calc-select {
  width: 100%;
  min-height: 44px;
  font-size: 0.9375rem;
  color: #0F172A;
  background-color: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease;
}

.calc-select:focus {
  border-color: var(--blue-2, #2563EB);
  background-color: #FFFFFF;
}

.calc-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1rem 0;
}

.calc-legend {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.375rem;
}

/* 라디오 세그먼트 버튼 그룹 */
.radio-pill-group {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.radio-pill-label {
  flex: 1;
  position: relative;
  cursor: pointer;
  margin: 0;
}

.radio-pill-label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-pill-text {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  background-color: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  text-align: center;
  transition: all 0.15s ease;
  padding: 0 0.5rem;
  box-sizing: border-box;
}

.radio-pill-label input:checked + .radio-pill-text {
  background-color: #EFF6FF;
  border-color: var(--blue-2, #2563EB);
  color: var(--blue-2, #2563EB);
}

.radio-pill-label input:focus-visible + .radio-pill-text {
  outline: 2px solid var(--blue-2, #2563EB);
  outline-offset: 2px;
}

/* 체크박스 스택 타일 */
.checkbox-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checkbox-tile-label {
  display: flex;
  align-items: center;
  min-height: 44px;
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  box-sizing: border-box;
}

.checkbox-tile-label input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--blue-2, #2563EB);
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.checkbox-tile-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 0.875rem;
  color: #1E293B;
}

.checkbox-tile-price {
  font-size: 0.8125rem;
  color: #64748B;
  white-space: nowrap;
}

/* 슬라이더 범위 인풋 */
.calc-range {
  width: 100%;
  height: 8px;
  background: #E2E8F0;
  border-radius: 4px;
  outline: none;
  accent-color: var(--blue-2, #2563EB);
  margin: 0.75rem 0 0.375rem;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #94A3B8;
}

/* 토글 스위치 컴포넌트 */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  width: 44px;
  height: 24px;
  background-color: #CBD5E1;
  border-radius: 24px;
  transition: background-color 0.2s;
  position: relative;
  flex-shrink: 0;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background-color: #FFFFFF;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--blue-2, #2563EB);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-switch input:focus-visible + .toggle-slider {
  outline: 2px solid var(--blue-2, #2563EB);
  outline-offset: 2px;
}

/* 안내 및 힌트 */
.field-hint {
  font-size: 0.8125rem;
  color: #64748B;
  margin: 0.375rem 0 0;
  line-height: 1.4;
}

.field-hint-small {
  font-size: 0.75rem;
  color: #64748B;
  margin: 0.5rem 0 0;
  line-height: 1.4;
}

.field-alert {
  font-size: 0.8125rem;
  color: #B45309;
  background-color: #FFFBEB;
  padding: 0.375rem 0.5rem;
  border-radius: 4px;
  margin-top: 0.375rem;
}

.info-tag-box {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.info-tag-item {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: #334155;
}

.tag-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  background-color: #E2E8F0;
  color: #334155;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
}

.tag-badge-accent {
  font-size: 0.6875rem;
  font-weight: 700;
  background-color: #DBEAFE;
  color: var(--blue-2, #2563EB);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
}

/* 결과 요약 박스 (우측 고정 & 모바일 하단 플로팅 바) */
.calc-result-box {
  background-color: #FFFFFF;
  color: #0F172A;
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
  overflow: hidden;
}

/* 모바일 전용 토글 바 */
.result-mobile-toggle {
  display: none;
  width: 100%;
  min-height: 52px;
  background-color: #0F172A;
  color: #FFFFFF;
  border: 0;
  padding: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-sizing: border-box;
}

.mobile-summary-preview {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.mobile-preview-label {
  font-size: 0.8125rem;
  color: #94A3B8;
}

.mobile-preview-val {
  font-size: 1.125rem;
  font-weight: 800;
  color: #FFFFFF;
  white-space: nowrap;
}

.mobile-toggle-action {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: #38BDF8;
}

/* 순수 CSS 화살표 도형 */
.arrow-shape {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid #38BDF8;
  border-bottom: 2px solid #38BDF8;
  transform: rotate(45deg);
  transition: transform 0.2s;
}

.result-mobile-toggle[aria-expanded="true"] .arrow-shape {
  transform: rotate(-135deg);
}

.result-box-inner {
  padding: 1.25rem;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #F1F5F9;
}

.result-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
  color: #0F172A;
}

.vat-toggle-group {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.vat-mode-label {
  font-size: 0.75rem;
  color: #64748B;
  font-weight: 600;
}

.vat-btn-switch {
  min-height: 32px;
  padding: 0 0.5rem;
  background-color: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

.vat-btn-switch:hover {
  background-color: #E2E8F0;
}

/* 메인 월 합계 패널 */
.result-main-price-panel {
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.main-price-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
}

.main-price-val-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin: 0.25rem 0;
}

.main-price-number {
  font-size: 2rem;
  font-weight: 900;
  color: var(--blue-2, #2563EB);
  white-space: nowrap;
  letter-spacing: -0.03em;
}

.main-price-unit {
  font-size: 1rem;
  font-weight: 700;
  color: #475569;
  margin-left: 0.25rem;
}

.main-price-sub {
  font-size: 0.75rem;
  color: #94A3B8;
}

/* 항목별 목록 */
.result-sub-heading {
  font-size: 0.875rem;
  font-weight: 700;
  color: #334155;
  margin: 0 0 0.5rem 0;
}

.result-breakdown-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
}

.result-line-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8125rem;
  padding: 0.375rem 0;
  border-bottom: 1px dashed #F1F5F9;
}

.result-line-item.is-empty {
  color: #94A3B8;
  justify-content: center;
  padding: 0.75rem 0;
}

.line-name {
  color: #475569;
  max-width: 65%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-price {
  font-weight: 700;
  color: #0F172A;
  white-space: nowrap;
}

.line-price.is-consult-val {
  color: #D97706;
  font-weight: 600;
}

/* 초기 비용 & 3년 총액 섹션 */
.result-initial-section {
  padding: 0.75rem 0;
  border-top: 1px solid #F1F5F9;
  border-bottom: 1px solid #F1F5F9;
  margin-bottom: 0.75rem;
}

.initial-price-row,
.contract-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.initial-label,
.contract-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
}

.initial-val {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0F172A;
  white-space: nowrap;
}

.initial-notice,
.contract-caption {
  font-size: 0.6875rem;
  color: #94A3B8;
  margin: 0.25rem 0 0 0;
  line-height: 1.3;
}

.result-contract-total-box {
  background-color: #F8FAFC;
  border-radius: 6px;
  padding: 0.625rem 0.75rem;
  margin-bottom: 1rem;
}

.contract-val {
  font-size: 1.0625rem;
  font-weight: 800;
  color: #0F172A;
  white-space: nowrap;
}

/* 상담 필요 항목 리스트 */
.consult-required-box {
  background-color: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 6px;
  padding: 0.625rem 0.75rem;
  margin-bottom: 1.25rem;
}

.consult-box-title {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: #B45309;
  margin-bottom: 0.375rem;
}

.info-dot-shape {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #B45309;
  display: inline-block;
}

.consult-need-list {
  margin: 0;
  padding-left: 1.125rem;
  font-size: 0.75rem;
  color: #92400E;
}

.consult-need-list li {
  margin-bottom: 0.125rem;
}

/* 액션 버튼 군 */
.result-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-action-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  background-color: var(--blue-2, #2563EB);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 700;
  border-radius: 8px;
  transition: background-color 0.15s ease;
  box-sizing: border-box;
}

.btn-action-primary:hover {
  background-color: #1D4ED8;
}

.secondary-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-action-secondary {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  background-color: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #334155;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 6px;
  box-sizing: border-box;
}

.btn-action-secondary:hover {
  background-color: #F8FAFC;
}

.btn-action-ghost {
  flex: 1;
  min-height: 44px;
  background-color: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  box-sizing: border-box;
}

.btn-action-ghost:hover {
  background-color: #F8FAFC;
}

/* 링크 복사 토스트 팝업 */
.toast-popup {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: rgba(15, 23, 42, 0.9);
  color: #FFFFFF;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 1000;
  pointer-events: none;
}

.toast-popup.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* 모바일 전용 결과창 플로팅 처리 */
@media (max-width: 1023px) {
  .calc-summary-column {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    width: 100%;
    padding: 0;
  }

  .calc-result-box {
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
  }

  .result-mobile-toggle {
    display: flex;
  }

  .result-box-inner {
    display: none;
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid #E2E8F0;
  }

  .result-box-inner.is-open {
    display: block;
  }
}

/* 계산 기준 안내 표 */
.calc-standards-section {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color, #E2E8F0);
}

.section-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-dark, #0F172A);
  margin: 0 0 0.5rem 0;
}

.section-desc {
  font-size: 0.875rem;
  color: var(--text-muted, #64748B);
  margin: 0 0 1.25rem 0;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.standards-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
}

.standards-table th,
.standards-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #E2E8F0;
}

.standards-table th {
  background-color: #F8FAFC;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

.standards-table td {
  color: #475569;
}

/* FAQ 및 쿠폰 하단 영역 간격 */
.calc-bottom-coupon-wrap {
  margin: 2.5rem 0;
}

.calc-faq-section {
  margin-top: 3rem;
}

/* 관련 링크 카드 영역 */
.calc-related-links {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .calc-related-links {
    grid-template-columns: repeat(2, 1fr);
  }
}

.related-links-card {
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 1.25rem;
}

.related-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue-2, #2563EB);
  background-color: #EFF6FF;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.related-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 0.5rem 0;
}

.related-text {
  font-size: 0.875rem;
  color: #64748B;
  margin: 0 0 1rem 0;
  line-height: 1.4;
}

.link-inline-cta {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--blue-2, #2563EB);
  text-decoration: none;
}

.link-inline-cta:hover {
  text-decoration: underline;
}

/* 노스크립트 안내 */
.noscript-guide-section {
  margin-top: 2rem;
  background-color: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 1.25rem;
}

.noscript-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .noscript-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.noscript-card {
  background-color: #FFFFFF;
  padding: 1rem;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
}

.noscript-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.noscript-card ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.8125rem;
  color: #475569;
}

/* 접근성 유틸리티 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
