label {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: var(--fs-3);
  text-align: left;
}

/* 반경은 css/tokens.css의 네 단계 계단에서 가져온다. 입력칸과 버튼은 손으로
 * 조작하는 것이므로 가장 안쪽 단계(--control-radius)에 선다. 여기서 8px을 손으로
 * 적어 두면 계단을 옮길 때 앱 절반만 따라 움직인다. 다만 컨트롤 안에 다시 들어가는
 * 작은 버튼(.password-field button 등)은 계단 밖의 6px이다 -- 8px 상자 안의 버튼이
 * 같은 8px이면 테두리에 닿는 모서리가 두 겹으로 보인다. */
input,
select,
textarea {
  width: 100%;
  padding: 12px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 189, 163, .18);
}

.auth input::placeholder {
  color: #9aa9a5;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--muted-strong);
  font-size: var(--fs-3);
}

.required-mark {
  color: var(--danger);
  font-size: var(--fs-4);
  font-weight: 900;
  line-height: 1;
}

.optional-mark {
  color: var(--muted);
  font-size: var(--fs-1);
  font-weight: 700;
}

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

.password-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  background: #fff;
}

.password-field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 189, 163, .18);
}

.password-field input {
  border: 0;
  background: transparent;
  outline: 0;
  box-shadow: none;
}

/* Edge exposes its own password reveal button; keep only our accessible toggle. */
.password-field input::-ms-reveal,
.password-field input::-ms-clear {
  display: none;
}

.password-field button {
  width: 34px;
  height: 34px;
  margin-right: 5px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: var(--brand-dark);
  background: none;
  cursor: pointer;
}

.password-field button:hover {
  background: var(--brand-soft);
}

.password-field svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-reset-controls {
  display: grid;
  gap: 8px;
  margin-top: -2px;
}

.password-reset-row {
  display: flex;
  justify-content: flex-end;
}

.password-reset-link {
  border: 0;
  padding: 0;
  color: var(--brand-dark);
  background: transparent;
  font-size: var(--fs-2);
  font-weight: 800;
  cursor: pointer;
}

.password-reset-link:hover {
  text-decoration: underline;
}

.password-reset-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--row-radius);
  background: var(--surface-muted);
}

.password-reset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.verification-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  background: #fff;
}

.verification-field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 189, 163, .18);
}

.verification-field input {
  min-width: 0;
  border: 0;
  background: transparent;
  outline: 0;
  box-shadow: none;
}

.verification-field-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 5px;
}

.verification-field button {
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  color: var(--brand-dark);
  background: none;
  font-size: var(--fs-1);
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.verification-field button:hover {
  background: var(--brand-soft);
}

.verification-field button.primary-inline {
  color: #fff;
  background: var(--brand-dark);
}

.verification-field button.primary-inline:hover {
  background: #066b5e;
}

.verification-status {
  min-height: 16px;
  color: var(--muted);
  font-size: var(--fs-2);
}

.verification-status.success {
  color: var(--brand-dark);
}

/* 한 줄짜리 라벨이라 가운데로 맞춘다 -- 두 줄(굵은 제목 + 설명)이던 시절의
   align-items: start는 이제 체크박스만 위로 밀어 올린다. */
.check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--row-radius);
  background: var(--surface-muted);
  padding: 10px;
}

.check-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--brand-dark);
}

.check-row span {
  min-width: 0;
}

.check-row b {
  color: var(--text);
  font-size: var(--fs-2);
}

textarea {
  resize: vertical;
}

form > button,
#add-button,
.primary {
  border: 0;
  border-radius: var(--control-radius);
  padding: 12px;
  color: #fff;
  background: var(--brand-dark);
  font-weight: 700;
  cursor: pointer;
}

form > button:hover,
#add-button:hover,
.primary:hover {
  background: #066b5e;
}

.secondary {
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface-strong);
  font-weight: 700;
  cursor: pointer;
}

.secondary:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.danger {
  border: 1px solid #fed7aa;
  border-radius: var(--control-radius);
  padding: 10px 12px;
  color: var(--danger);
  background: #fff7ed;
  font-weight: 700;
  cursor: pointer;
}

.danger:hover {
  border-color: var(--danger);
  background: #ffedd5;
}

.verification-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.verification-actions span {
  min-width: 0;
  color: var(--muted);
  font-size: var(--fs-2);
}

.verification-actions span.success {
  color: var(--brand-dark);
}

button:disabled {
  opacity: .6;
  cursor: not-allowed !important;
}

#auth-error,
.form-error {
  min-height: 16px;
  margin: 0;
  color: var(--danger);
  font-size: var(--fs-2);
  white-space: pre-line;
}

.field-error {
  color: var(--danger);
  font-size: var(--fs-2);
  line-height: 1.4;
}

/* Without this, <small> inherits the browser default (0.83em ≈ 11.7px) and drops below the
   12px floor the rest of the console keeps. */
label > small {
  color: var(--muted);
  font-size: var(--fs-1);
  line-height: 1.45;
}

/* 18px is the UA default and undershoots the 24px minimum target size. */
input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 2px;
  accent-color: var(--brand-dark);
}

.field-error:empty {
  display: none;
}

[aria-invalid="true"] {
  border-color: var(--danger);
}

[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(194, 65, 12, .18);
}

/* 인증 코드 칸은 로그인·가입 판(main 안)에만 선다 -- 2026-08-11: 뷰포트 대신
 * main 컬럼 폭(@container content-col, css/layout.css) 기준으로 이관. */
@container content-col (width < 720px) {
  .verification-field {
    grid-template-columns: minmax(0, 1fr);
  }

  .verification-field-actions {
    justify-content: flex-end;
    margin: 0 6px 6px;
  }

  .password-reset-grid {
    grid-template-columns: 1fr;
  }
}
