/* =========================================================
   공통 토큰 · 리셋 · 버튼 · 입력 요소
   - 색, 글꼴, 간격은 :root 토큰만 바꾸면 전체에 반영됩니다.
   - 레이아웃 규격: PC 콘텐츠 1200px 가운데 정렬 / 모바일 375 기준 좌우 여백 20px
   ========================================================= */
:root {
  /* 시안 글꼴: Noto Sans KR (Google Fonts) */
  --font-sans: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Malgun Gothic',
    sans-serif;

  /* 시안 색상 */
  --c-primary: #0050d0;
  --c-primary-hover: #0043b0;
  --c-primary-weak: #e8effc;
  --c-primary-ring: rgba(0, 80, 208, 0.2);
  --c-navy: #00245c;

  --c-text: #151a35;
  --c-text-sub: #3a3d4d;
  --c-text-muted: #6b7083;
  --c-border: #d1d5db;
  --c-border-weak: #e5e7eb;

  --c-bg: #ffffff;
  --c-bg-soft: #f4f6fb;
  --c-bg-dark: #00245c;

  --c-error: #d92d20;
  --c-error-weak: #fef3f2;
  --c-success: #079455;

  /* 레이아웃: 시안 기준 캔버스 1920 / 콘텐츠 1104 가운데 정렬, 모바일 좌우 여백 20 */
  --content-max: 1104px;
  --gutter: 20px;
  --header-h: 52px;

  --radius-sm: 4px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-lg: 0 24px 64px rgba(10, 18, 32, 0.24);
}

@media (min-width: 768px) {
  :root {
    --gutter: 40px;
    --header-h: 56px;
  }
}

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

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

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: calc(var(--content-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

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

.btn--primary:hover:not(:disabled) {
  background: var(--c-primary-hover);
}

.btn--outline {
  background: #fff;
  border-color: var(--c-border);
  color: var(--c-text);
}

.btn--outline:hover:not(:disabled) {
  border-color: var(--c-text-muted);
}

.btn--white {
  background: #fff;
  color: var(--c-primary);
}

.btn--white:hover:not(:disabled) {
  background: var(--c-primary-weak);
}

.btn--lg {
  min-height: 56px;
  padding: 0 32px;
  font-size: 17px;
  border-radius: var(--radius);
}

.btn--block {
  display: flex;
  width: 100%;
}

/* ---------- 입력 요소 ---------- */
.input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: #fff;
  font-size: 16px; /* iOS 확대 방지를 위해 16px 이상 */
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder {
  color: #9ca3af;
}

.input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-ring);
}

textarea.input {
  height: auto;
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
}

select.input {
  padding-right: 36px;
  appearance: none;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.6'/%3E%3C/svg%3E")
    no-repeat right 14px center;
}

.is-invalid .input,
.input[aria-invalid='true'] {
  border-color: var(--c-error);
}

.is-invalid .input:focus,
.input[aria-invalid='true']:focus {
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.15);
}

/* ---------- 미확정 값 표시: [[ ]] 자리표시자 ---------- */
.todo-placeholder {
  padding: 0 0.3em;
  border-radius: 3px;
  background: #fff1a8;
  color: #7a4100;
  outline: 1px dashed #d9a400;
  font-style: normal;
  font-weight: 600;
}

/* ---------- 목업/설정 오류 배지 ---------- */
.mode-badge {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 9999;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.85);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  pointer-events: none;
}

.mode-badge--error {
  background: var(--c-error);
}
