/* Freeworker Tools — Calculator Styles */

.fwt-calculator {
  max-width: 480px;
  margin: 1.5rem 0;
  padding: 1.5rem;
  border: 1px solid #e2e4ea;
  border-radius: 8px;
  background: #fff;
  font-family: -apple-system, 'Noto Sans KR', sans-serif;
}

.fwt-calculator__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1.2rem;
  padding: 0;
  color: #1b1d2a;
}

/* 입력 필드 */
.fwt-field {
  margin-bottom: 0.9rem;
}

.fwt-field__label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.3rem;
}

.fwt-field__input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.fwt-field__input-wrap:focus-within {
  border-color: #2558d6;
  box-shadow: 0 0 0 2px rgba(37, 88, 214, 0.15);
}

.fwt-field__input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  background: transparent;
  min-width: 0;
}

.fwt-field__suffix {
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  color: #6b7280;
  background: #f3f4f6;
  border-left: 1px solid #d1d5db;
  white-space: nowrap;
}

/* 라디오 모드 선택 */
.fwt-mode {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.fwt-mode__option {
  flex: 1;
}

.fwt-mode__option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fwt-mode__option label {
  display: block;
  text-align: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  color: #374151;
  background: #fff;
}

.fwt-mode__option input[type="radio"]:checked + label {
  border-color: #2558d6;
  background: #eef2fc;
  color: #2558d6;
  font-weight: 600;
}

.fwt-mode__option input[type="radio"]:focus-visible + label {
  box-shadow: 0 0 0 2px rgba(37, 88, 214, 0.3);
}

/* 계산 버튼 */
.fwt-btn {
  display: block;
  width: 100%;
  padding: 0.7rem;
  margin-top: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: #2558d6;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.fwt-btn:hover {
  background: #1e47b5;
}

.fwt-btn:active {
  background: #183c9a;
}

.fwt-btn:focus-visible {
  outline: 2px solid #2558d6;
  outline-offset: 2px;
}

/* 결과 영역 */
.fwt-calculator__result {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e4ea;
}

.fwt-result__grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fwt-result__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.4rem 0;
}

.fwt-result__label {
  font-size: 0.82rem;
  color: #6b7280;
}

.fwt-result__value {
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #1b1d2a;
}

.fwt-result__item--highlight .fwt-result__value {
  color: #c53030;
}

.fwt-result__item--primary {
  padding: 0.6rem 0.75rem;
  background: #eef2fc;
  border-radius: 6px;
  margin-top: 0.25rem;
}

.fwt-result__item--primary .fwt-result__label {
  font-weight: 600;
  color: #1b1d2a;
}

.fwt-result__item--primary .fwt-result__value {
  font-size: 1.15rem;
  color: #2558d6;
}

.fwt-result__formula {
  font-size: 0.75rem;
  color: #9ca3af;
  margin: 0.6rem 0 0;
}

.fwt-result__error {
  color: #c53030;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  background: #fef2f2;
  border-radius: 4px;
  margin: 0;
}

/* 면책 고지 */
.fwt-calculator__disclaimer {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid #e2e4ea;
  font-size: 0.72rem;
  line-height: 1.65;
  color: #9ca3af;
}

/* 관련 공식 자료 */
.fwt-calculator__references {
  margin-top: 0.6rem;
  font-size: 0.72rem;
  line-height: 1.6;
  color: #9ca3af;
}

.fwt-calculator__references-label {
  font-weight: 600;
  color: #6b7280;
}

.fwt-calculator__references a {
  color: #2558d6;
  text-decoration: none;
}

.fwt-calculator__references a:hover {
  text-decoration: underline;
}

/* 반응형 */
@media (max-width: 520px) {
  .fwt-calculator {
    padding: 1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
    max-width: 100%;
  }
}
