/* 공통 토큰과 기본 요소
   방향: 차분하고 숫자에 정확하고 조금 따뜻하게. 세무사 책상 위 종이와 인주 */

:root {
  --bg: #f7f4ee;
  --card: #fdfbf7;
  --raised: #efe9df;
  --text: #1f1b16;
  --text-2: #5e554a;
  --muted: #776e62;
  --line: rgba(31, 27, 22, 0.09);
  --line-strong: rgba(31, 27, 22, 0.16);

  --accent: #b03a1e;        /* 인주 */
  --accent-ink: #9a3219;    /* 글자로 쓸 때 */
  --accent-soft: rgba(176, 58, 30, 0.08);

  --positive: #2f7a46;
  --negative: #c2372b;

  --r-small: 6px;
  --r-control: 8px;
  --r-card: 14px;
  --r-panel: 16px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-sm: 0 1px 2px rgba(31, 27, 22, 0.05);
  --shadow-float: 0 8px 24px rgba(31, 27, 22, 0.07);

  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* 휴대폰에서 화면이 좌우로 밀리지 않게. clip 은 hidden 과 달리 스크롤 상자를 만들지 않아 sticky 를 깨지 않는다 */
html,
body {
  overflow-x: clip;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "tnum";
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 500;
}

.num {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- 버튼 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--r-control);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 120ms var(--ease);
}

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

.btn-primary {
  background: var(--text);
  color: #fdfbf7;
}

.btn-primary:hover {
  background: #3a332b;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-ink);
}

.btn-secondary {
  background: var(--card);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--raised);
}

.btn-quiet {
  background: transparent;
  color: var(--text-2);
  padding: 0 12px;
}

.btn-quiet:hover {
  background: var(--raised);
  color: var(--text);
}

.btn-lg {
  height: 48px;
  padding: 0 20px;
  font-size: 15px;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 입력 ---------- */

.field {
  display: grid;
  gap: 8px;
}

.field > label,
.field > .label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.field .opt {
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}

.input,
.select,
.textarea {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color 150ms var(--ease), background-color 150ms var(--ease);
}

.textarea {
  height: auto;
  min-height: 148px;
  padding: 12px;
  line-height: 1.6;
  resize: vertical;
}

.select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23776e62' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: rgba(31, 27, 22, 0.28);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--text);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--placeholder, #a39a8d);
}

.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
  border-color: var(--negative);
}

.error-text {
  font-size: 13px;
  color: var(--negative);
}

.help {
  font-size: 13px;
  color: var(--muted);
}

/* 선택 칩 (라디오, 체크박스) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  position: relative;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background: #fff;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}

.chip span:hover {
  border-color: rgba(31, 27, 22, 0.3);
  color: var(--text);
}

.chip input:checked + span {
  background: var(--text);
  border-color: var(--text);
  color: #fdfbf7;
}

.chip input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--text);
}

/* 아이콘 */
.icon {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 세목 점 */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}

/* 세목 꼬리표: --c 에 세목 색을 넣는다 */
.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--c, #7b7266) 13%, #fff);
  color: color-mix(in srgb, var(--c, #7b7266) 70%, #000);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

/* 알림 줄 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 8px);
  padding: 12px 16px;
  border-radius: var(--r-control);
  background: var(--text);
  color: #fdfbf7;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 도장 (시그니처) ---------- */

.stamp {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.08em;
  transform: rotate(-8deg);
  opacity: 0.88;
  box-shadow: inset 0 0 0 3px #fdfbf7, inset 0 0 0 4px rgba(176, 58, 30, 0.55);
}

/* 두 줄 도장: 견적 / 완료. 견적서의 주인공이라 크고 진하게 */
.stamp.stamp-done {
  width: 84px;
  height: 84px;
  border-width: 3px;
  background: rgba(176, 58, 30, 0.06);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-align: center;
  opacity: 1;
  transform: rotate(-10deg);
  box-shadow: inset 0 0 0 4px #fdfbf7, inset 0 0 0 6px var(--accent);
}

.stamp.waiting {
  border-style: dashed;
  border-color: var(--line-strong);
  color: var(--muted);
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  transform: none;
  opacity: 1;
}

/* ---------- 하단 ---------- */

.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--line);
  background: var(--card);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.footer-links a {
  color: var(--text-2);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-info {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 40px;
  font-size: 13px;
  color: var(--muted);
}

.footer-info dl {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0;
}

.footer-info dl > div {
  display: flex;
  gap: 8px;
}

.footer-info dl > div + div::before {
  content: "";
  width: 1px;
  height: 12px;
  margin: 4px 4px 0 12px;
  background: var(--line-strong);
}

.footer-info dt {
  color: var(--muted);
}

.footer-info dd {
  margin: 0;
  color: var(--text-2);
}

.footer-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

.footer-note {
  margin-top: 8px;
}

.footer-side {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

@media (max-width: 720px) {
  .wrap {
    padding: 0 16px;
  }

  /* 아이폰은 16px 보다 작은 입력칸을 누르면 화면을 확대하고, 그 뒤로 화면이 좌우로 움직인다 */
  .input,
  .select,
  .textarea {
    font-size: 16px;
  }

  .footer-info {
    flex-direction: column;
  }

  .footer-info dl {
    flex-direction: column;
  }

  .footer-info dl > div + div::before {
    display: none;
  }
}
