:root {
  --primary-blue: #2563eb;
  --primary-blue-dark: #1e40af;
  --primary-blue-light: #3b82f6;
  --secondary-gray: #f8fafc;
  --border-gray: #e2e8f0;
  --text-dark: #1e293b;
  --text-gray: #64748b;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* 카드 스타일 */
.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 섹션 헤더 - 컴팩트 */
.section-header {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 입력 필드 스타일 - 컴팩트 */
.input-group {
  background: var(--secondary-gray);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.input-group:hover {
  border-color: var(--border-gray);
  background: white;
}

/* 메인 입력 섹션 간격 */
.main-input-section {
  margin-bottom: 16px;
}

.input-label {
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.75rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.input-field {
  width: 100%;
  padding: 6px 10px;
  border: 2px solid var(--border-gray);
  border-radius: 6px;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  background: white;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 라디오/체크박스 스타일 - 컴팩트 */
.option-card {
  background: white;
  border: 2px solid var(--border-gray);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.option-card:hover {
  border-color: var(--primary-blue-light);
  background: #eff6ff;
}

.peer:checked ~ .option-card {
  border-color: var(--primary-blue);
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
  transform: scale(1.02);
}

.option-card.active {
  border-color: var(--primary-blue);
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

/* 초기화 버튼 스타일 */
.reset-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.reset-btn:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.reset-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* 철판막음 모달 스타일 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 9999;
  overflow-y: auto;
  padding: 20px;
}

.modal-container {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: modalSlideDown 0.3s ease-out;
}

@keyframes modalSlideDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: white;
  padding: 16px 20px;
  border-radius: 16px 16px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.modal-footer {
  background: #f8fafc;
  padding: 16px 20px;
  border-radius: 0 0 16px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
  border-top: 1px solid var(--border-gray);
}

.modal-btn-primary {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.modal-btn-primary:hover {
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.4);
  transform: translateY(-2px);
}

.modal-btn-secondary {
  background: white;
  color: var(--text-gray);
  border: 2px solid var(--border-gray);
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-btn-secondary:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  background: #eff6ff;
}

.steel-plate-item {
  background: white;
  border: 2px solid var(--border-gray);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.3s ease;
}

.steel-plate-item:hover {
  border-color: var(--primary-blue-light);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.modal-radio-option {
  cursor: pointer;
  display: block;
}

.modal-radio-card {
  background: white;
  border: 2px solid var(--border-gray);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
}

.modal-radio-card:hover {
  border-color: var(--primary-blue-light);
  background: #eff6ff;
}

.peer:checked ~ .modal-radio-card {
  border-color: var(--primary-blue);
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.modal-radio-card.active {
  border-color: var(--primary-blue);
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

/* 견적 결과 카드 - 컴팩트 */
.result-card {
  background: white;
  border-radius: 12px;
  padding: 12px;
  min-height: 400px;
  position: sticky;
  top: 10px;
}

.result-header {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #1f2937;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 12px;
  text-align: center;
  border: 1px solid #d1d5db;
}

.result-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
  color: #111827;
}

.result-header .subtitle {
  font-size: 0.75rem;
  opacity: 0.7;
  color: #4b5563;
}

.price-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 0;
  font-size: 0.8rem;
}

.price-item:last-child {
  border-bottom: none;
}

.price-item.total {
  background: #f9fafb;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 12px;
  margin-top: 8px;
  border-top: 2px solid #d1d5db;
  border-bottom: none;
}

.price-item.grand-total {
  background: #eff6ff;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 14px 12px;
  margin-top: 4px;
  border-top: 2px solid #2563eb;
  border-bottom: none;
}

.price-label {
  color: #374151;
  font-weight: 500;
  font-size: 0.85rem;
}

.price-label.total-label {
  color: #111827;
  font-weight: 700;
}

.price-label.grand-total-label {
  color: #1e40af;
  font-weight: 700;
}

.price-value {
  color: #111827;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: right;
}

.price-value.total-value {
  color: #111827;
  font-weight: 700;
  font-size: 1.05rem;
}

.price-value.grand-total-value {
  color: #1e40af;
  font-weight: 700;
  font-size: 1.3rem;
}

.price-value.discount {
  color: #ef4444;
}

/* 버튼 스타일 - 컴팩트 */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.8rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
  background: white;
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--primary-blue);
  color: white;
}

/* 숫자 입력 필드의 증감 버튼(spinner) 제거 */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* 애니메이션 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* 헤더 스타일 - 컴팩트 */
.main-header {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding: 12px 20px;
  margin-bottom: 12px;
}

.main-header h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-header .header-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

/* 커스텀 체크박스 스타일 - 컴팩트 */
.custom-checkbox {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1.5px solid var(--border-gray);
  border-radius: 6px;
  background: white;
  transition: all 0.3s ease;
  font-size: 0.7rem;
  font-weight: 600;
}

.checkbox-label:hover {
  border-color: var(--primary-blue-light);
  background: #eff6ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

.custom-checkbox input[type="checkbox"]:checked ~ .checkbox-label {
  border-color: var(--primary-blue);
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.checkbox-icon {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border-gray);
  border-radius: 3px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.custom-checkbox input[type="checkbox"]:checked ~ .checkbox-label .checkbox-icon {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
}

.checkbox-icon::after {
  content: "✓";
  color: white;
  font-size: 10px;
  font-weight: bold;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
}

.custom-checkbox input[type="checkbox"]:checked ~ .checkbox-label .checkbox-icon::after {
  opacity: 1;
  transform: scale(1);
}

/* 하드웨어 탭 스타일 */
.hardware-tab {
  position: relative;
  transition: all 0.3s ease;
}

.hardware-tab.active {
  border-bottom-color: #eab308 !important;
  background-color: #fef9c3 !important;
  color: #854d0e !important;
}

.hardware-tab:not(.active):hover {
  background-color: #fef9c3;
  border-bottom-color: #fbbf24;
}

/* 방화문 타입 탭 스타일 - 다나와 스타일 */
.fire-door-tabs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.fire-door-tab {
  flex: 1;
  padding: 14px 16px;
  text-align: center;
  cursor: pointer;
  background: white;
  border-right: 1px solid #e5e7eb;
  color: #374151;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.fire-door-tab:last-child {
  border-right: none;
}

.fire-door-tab:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.fire-door-tab.active {
  background: #3b82f6;
  color: white;
  font-weight: 700;
}

/* 반응형: 작은 화면에서 2줄로 표시 */
@media (max-width: 1024px) {
  .fire-door-tabs {
    flex-wrap: wrap;
  }
  
  .fire-door-tab {
    flex: 1 1 calc(50% - 1px);
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
  }
  
  .fire-door-tab:nth-child(2n) {
    border-right: none;
  }
  
  .fire-door-tab:nth-last-child(-n+2) {
    border-bottom: none;
  }
}
