/* 그래도별 화면 공통 스타일 — 펫바통 app.css 구조·클래스 이름을 따르고 색만 바꿨다. 밤하늘 남색 + 별 노랑 */
:root {
  --navy: #1e2a5a;
  --navy-dark: #141d42;
  --star: #f7c948;
  --paper: #f6efe4;
  --ink: #1d2033;
  --muted: #5d6176;
  --line: #e3dccd;
  --white: #fff;
  --red: #d93c3c;
  --accent: #1e2a5a;   /* 글자·체크칸에 쓰는 강조색 (다크 모드에서는 별 노랑) */
  --focus: #1e2a5a;    /* 초점 표시: 흰 바탕 13.69:1, 크림 바탕 11.99:1 (다크 모드는 별 노랑) */
  --field-line: #8f8a7c; /* 입력칸 테두리: 흰 바탕 3.45:1, 크림 바탕 3.02:1 */
  color-scheme: light dark;
}
/* 다크 모드: 밤하늘 바탕. 남색 버튼은 어두운 바탕에서도 보이게 밝힌다 */
@media (prefers-color-scheme: dark) {
  :root {
    --navy: #3a4a8f; --navy-dark: #5566b0; --accent: #f7c948; --focus: #f7c948;
    --field-line: #6e7bb5;   /* 입력칸 테두리: #18213f 위 3.89:1, #0f1630 위 4.38:1 */
    --paper: #0f1630; --white: #18213f; --ink: #eef0f8; --muted: #a9b0cc; --line: #2c3660;
    --red: #ff7a7a;   /* 오류 글자: #18213f 위 6.26:1, #0f1630 위 7.06:1 */
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  line-height: 1.55; word-break: keep-all; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, p { margin: 0; }
h1, h2 { text-wrap: balance; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

.top { max-width: 480px; margin: 0 auto; padding: 16px; display: flex; align-items: center; gap: 8px; }
.logo { margin-left: auto; font-weight: 800; color: var(--accent); text-decoration: none; }
main { max-width: 480px; margin: 0 auto; padding: 0 16px 48px; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 8px 28px rgba(20, 29, 66, .06); padding: 28px 22px; }
h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.sub { color: var(--muted); margin-top: 6px; font-size: 15px; }

form { display: grid; gap: 18px; margin-top: 24px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.field input { width: 100%; border: 1px solid var(--field-line); border-radius: 12px; padding: 13px 14px; background: var(--white); color: var(--ink); font-size: 16px; }
.field input:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px var(--focus); }
.field input[aria-invalid="true"] { border-color: var(--red); }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.error { font-size: 13px; color: var(--red); margin-top: 6px; }
.error:empty { display: none; }

fieldset.consent { border: 1px solid var(--line); border-radius: 14px; padding: 6px 14px; margin: 0; }
.consent legend { font-weight: 700; font-size: 14px; padding: 0 4px; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-size: 14px; }
.check + .check { border-top: 1px solid var(--line); }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 0; }
.req { color: var(--accent); font-weight: 700; }
.check a { margin-left: auto; font-size: 13px; color: var(--muted); }

.btn { width: 100%; display: inline-flex; justify-content: center; align-items: center; border: 0; border-radius: 14px; padding: 16px 20px; font-weight: 800; font-size: 16px; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.under { text-align: center; font-size: 14px; color: var(--muted); margin-top: 16px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 40; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }
.spinner { display: block; width: 28px; height: 28px; margin: 0 auto 12px; border: 3px solid var(--line); border-top-color: var(--star); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
