/* Ruach 디자인 표준 — 바탕 (초기화 · 글자 · 단추 · 입력칸 · 스위치). tokens.css 다음에 불러온다. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--win); color: var(--text); font: 15px/1.5 var(--font); letter-spacing: -0.01em; word-break: keep-all; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--accent-text); text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: 0 0 0 3.5px var(--ring); }
.num { font-variant-numeric: tabular-nums; }

/* 단추: 기본은 글자만, 주 단추(primary)는 강조색 알약, 보조(plain)는 회색 알약 */
button { cursor: pointer; border: 0; background: none; border-radius: var(--r-sm); height: var(--h-ctl); padding: 0 12px; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; transition: background-color .12s, color .12s, box-shadow .12s, filter .12s, transform .12s; }
button:disabled { opacity: 0.45; cursor: default; }
button svg, a svg { flex: none; }
button.primary { background: var(--accent); color: #fff; border-radius: var(--r-pill); padding: 0 16px; font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }
button.primary:hover:not(:disabled) { background: var(--accent-hover); }
button.primary:active:not(:disabled) { filter: brightness(0.94); }
button.plain { background: var(--fill); color: var(--text); border-radius: var(--r-pill); padding: 0 14px; }
button.plain:hover:not(:disabled) { filter: brightness(0.96); }
button.ghost { color: var(--accent-text); padding: 0 10px; }
button.ghost:hover:not(:disabled) { background: var(--accent-soft); }
button.danger { color: var(--err); }
button.danger:hover:not(:disabled) { background: var(--err-soft); }
button.icon { width: var(--h-ctl); padding: 0; color: var(--text-2); }
button.icon:hover:not(:disabled) { background: var(--hover); color: var(--text); }
button.icon:active:not(:disabled) { background: var(--press); }
button.block { width: 100%; height: var(--h-touch); font-size: 16px; }
button.block:active:not(:disabled) { transform: scale(.98); }

/* 입력칸 */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; color: var(--text-2); font-weight: 500; padding-left: 2px; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=date], input[type=search], input[type=number], input[type=url], select, textarea {
  height: var(--h-input); padding: 0 12px; border-radius: var(--r); border: 1px solid var(--input-line); background: var(--input); width: 100%; min-width: 0; font-size: 15px;
  box-shadow: 0 0.5px 1px rgb(0 0 0 / 0.04); transition: border-color .12s, box-shadow .12s; -webkit-appearance: none; appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14'%3E%3Cpath d='M2 5l3-3 3 3M2 9l3 3 3-3' fill='none' stroke='%238e8e93' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
select option { background-color: var(--raised); }
textarea { height: auto; min-height: 80px; padding: 9px 12px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--ring); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
input[type=file] { font-size: 14px; }
input[type=file]::file-selector-button { border: 0; border-radius: var(--r-pill); background: var(--fill); color: var(--text); padding: 7px 14px; margin-right: 10px; font: inherit; font-weight: 500; cursor: pointer; }

/* 아이폰 스위치: <input type="checkbox" class="switch"> */
input.switch { -webkit-appearance: none; appearance: none; position: relative; width: 42px; height: 26px; margin: 0; padding: 0; flex: none; border: 0; border-radius: 13px; background: var(--fill); cursor: pointer; transition: background-color .2s; }
input.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgb(0 0 0 / 0.2), 0 0 0 0.5px rgb(0 0 0 / 0.04); transition: transform .22s cubic-bezier(.3, 1.3, .5, 1); }
input.switch:checked { background: var(--green); }
input.switch:checked::after { transform: translateX(16px); }
input.switch:disabled { opacity: .45; cursor: default; }

.msg { font-size: 13px; }
.msg.err { color: var(--err); }
.msg:empty { display: none; }
.hint { font-size: 13px; color: var(--text-3); line-height: 1.5; }

/* 휴대폰: 손가락 크기 (입력칸 16px 이상 — iOS 가 확대하지 않게) */
@media (max-width: 899px) {
  input[type=text], input[type=password], input[type=email], input[type=tel], input[type=date], input[type=search], input[type=number], input[type=url], select, textarea { height: var(--h-touch); font-size: 16px; border-radius: var(--r-md); }
  textarea { height: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
