/**
 * 인증 · 계정 화면 cx 외피 — 다크 · 라이트 (GOCDSS-6242)
 *
 * 대상: login · new-signup · forgot · reset-password · initial-password · seat-blocked · actor-gate
 * 토큰: public/css/console/cx-tokens.css (관리 콘솔과 같은 값), 테마: views/common/cx-theme.html 이 정한 <html data-cx-theme>.
 *
 * 규칙
 * - 시각만 바꾼다. 화면 동작 · 폼 name/id · JS 가 잡는 셀렉터 · 문구는 그대로다(이 파일은 색 · 테두리 · 둥글기 · 그림자 · 글자 크기만).
 * - 모든 규칙을 body.cx-auth 아래로 한정한다 — 같은 클래스(.frame · .text-input · .login-button 등)를 쓰는 다른 화면에 새지 않게.
 * - 기존 CSS(login.css · actor-gate.css · seat-blocked.css · new-signup.css)는 고치지 않고 뒤에서 덮는다.
 *   기존 CSS 의 !important(input:focus 흰 글자 · 자동완성)와 인라인 style(bottom-info 글자색), 앱 전역 각진 모서리
 *   (common.css * { border-radius: 0 !important })만 !important 로 맞선다 — cx 의 둥근 모서리는 이 화면들 안에서만.
 * - 동물병원(X Caliber)은 body.cx-vet — 주 색을 브랜드 보라(#782eff)로 유지한다. 로고 분기는 뷰가 그대로 한다.
 */

/* ── 화면 토큰(브랜드 · 배경 빛) ───────────────────────────────────── */
body.cx-auth {
  --cx-auth-accent: var(--cx-primary);
  --cx-auth-accent-hover: var(--cx-primary-hover);
  --cx-auth-glow: rgba(47, 111, 237, 0.16);
  --cx-auth-card-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  --cx-auth-select-arrow: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23e5e7eb' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
html[data-cx-theme='light'] body.cx-auth {
  --cx-auth-glow: rgba(3, 105, 161, 0.1);
  --cx-auth-card-shadow: 0 24px 64px rgba(15, 42, 68, 0.12);
  --cx-auth-select-arrow: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%234b5563' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
body.cx-auth.cx-vet {
  --cx-auth-accent: #782eff;
  --cx-focus: rgba(120, 46, 255, 0.5);
  /* [GOCDSS-6328] 포커스 선 — 브랜드 보라의 밝은 단계(어두운 면 위 3:1 이상). 밝은 테마는 브랜드 보라 그대로 */
  --cx-input-border-focus: #9a62ff;
  --cx-auth-accent-hover: #8a4bff;
  --cx-auth-glow: rgba(120, 46, 255, 0.18);
}
html[data-cx-theme='light'] body.cx-auth.cx-vet {
  --cx-auth-accent-hover: #6a1ff0;
  --cx-input-border-focus: #782eff;
  --cx-auth-glow: rgba(120, 46, 255, 0.08);
}

/* ── 바탕 ─────────────────────────────────────────────────────────── */
html[data-cx-theme] body.cx-auth {
  color: var(--cx-text);
  background: radial-gradient(1100px 560px at 50% -12%, var(--cx-auth-glow), transparent 70%), var(--cx-bg);
  background-attachment: fixed;
  min-height: 100vh;
}

/* ── 머리(로고 · 언어 · 테마 버튼) ───────────────────────────────── */
body.cx-auth .head-area {
  background: transparent;
  border-bottom: 1px solid var(--cx-line);
}
body.cx-auth #gowix {
  color: var(--cx-text);
  font-weight: 600;
  letter-spacing: -0.01em;
}
body.cx-auth .medical-logo-svg {
  border-radius: 10px !important;
}
body.cx-auth .language-area {
  align-items: center;
  gap: 8px;
}
body.cx-auth .language-area-label {
  margin-top: 0;
  opacity: 0.8;
}
html[data-cx-theme='light'] body.cx-auth .language-area-label {
  /* 지구본 아이콘은 흰 선이라 밝은 바탕에서 사라진다 — 어둡게 뒤집는다 */
  filter: invert(1) brightness(0.45);
}
body.cx-auth .language-change {
  background: var(--cx-input-bg);
  color: var(--cx-text);
  border: 1px solid var(--cx-input-border);
  border-radius: var(--cx-radius) !important;
  font-size: 14px;
  height: 32px;
  padding: 0 8px;
}
body.cx-auth .language-change option {
  background: var(--cx-surface);
  color: var(--cx-text);
}

/* 테마 버튼(views/common/cx-theme-toggle.html) — 누르면 될 모습을 글로 보여준다 */
body.cx-auth .cx-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--cx-line-strong);
  border-radius: 999px !important;
  background: transparent;
  color: var(--cx-text-2);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
body.cx-auth .cx-theme-btn:hover {
  color: var(--cx-text);
  background: var(--cx-hover);
}
body.cx-auth .cx-theme-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--cx-focus);
}
body.cx-auth .cx-theme-btn-icon {
  width: 12px;
  height: 12px;
  border-radius: 50% !important;
  border: 1.5px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}
body.cx-auth .cx-theme-btn-to-dark,
html[data-cx-theme='light'] body.cx-auth .cx-theme-btn-to-light {
  display: none;
}
html[data-cx-theme='light'] body.cx-auth .cx-theme-btn-to-dark {
  display: inline;
}

/* ── 카드(로그인 · 재설정 · 첫 접속 · 개인 확인 · 좌석) ─────────────── */
body.cx-auth .frame {
  background: var(--cx-surface);
  border: 1px solid var(--cx-line);
  border-radius: 14px !important;
  box-shadow: var(--cx-auth-card-shadow);
  padding: 24px 32px;
}
body.cx-auth .login-title {
  color: var(--cx-text);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
body.cx-auth .frame2 {
  color: var(--cx-text-2);
}

/* 입력 — 로그인(.frame2-1/.frame2-2 input) · 재설정 · 가입(.text-input) 공통 */
body.cx-auth .frame2-1 input,
body.cx-auth .frame2-2 input,
body.cx-auth .text-input,
body.cx-auth #actor-select,
body.cx-auth #country,
body.cx-auth .forgot-form #email {
  background-color: var(--cx-input-bg);
  color: var(--cx-text);
  border: 1px solid var(--cx-input-border); /* [GOCDSS-6328] 입력칸 경계 3:1 */
  border-radius: 8px !important;
  font-size: 16px;
  font-weight: 400;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
body.cx-auth .frame2-1 input::placeholder,
body.cx-auth .frame2-2 input::placeholder,
body.cx-auth .text-input::placeholder,
body.cx-auth .forgot-form #email::placeholder {
  color: var(--cx-text-3);
}
body.cx-auth .frame2-1 input:hover,
body.cx-auth .frame2-2 input:hover,
body.cx-auth .text-input:hover,
body.cx-auth #actor-select:hover,
body.cx-auth #country:hover,
body.cx-auth .forgot-form #email:hover,
body.cx-auth .language-change:hover {
  border-color: var(--cx-input-border-hover);
}
body.cx-auth .frame2-1 input:focus,
body.cx-auth .frame2-2 input:focus,
body.cx-auth .text-input:focus,
body.cx-auth #actor-select:focus,
body.cx-auth #country:focus,
body.cx-auth .language-change:focus,
body.cx-auth .forgot-form #email:focus {
  outline: none;
  border-color: var(--cx-input-border-focus);
  box-shadow: 0 0 0 1px var(--cx-input-border-focus), 0 0 0 4px var(--cx-focus);
}
/* login.css 의 input:focus { color: white !important } 를 테마 글자색으로 */
body.cx-auth input:focus {
  color: var(--cx-text) !important;
}
/* 브라우저 자동완성 배경 · 글자 — login.css · new-signup.css 의 어두운 고정값을 테마 값으로 */
body.cx-auth input:-webkit-autofill,
body.cx-auth input:-webkit-autofill:hover,
body.cx-auth input:-webkit-autofill:focus,
body.cx-auth input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px var(--cx-input-bg) inset !important;
  -webkit-text-fill-color: var(--cx-text);
  caret-color: var(--cx-text);
}

/* 주 버튼 — 의료 cx 주 색, 동물병원 브랜드 보라(.vet-login-button 도 같은 값) */
body.cx-auth .login-button,
body.cx-auth .signup-container .signup-button,
body.cx-auth .hospital-type-button,
body.cx-auth .forgot-form .submit-button {
  background: var(--cx-auth-accent);
  color: #ffffff;
  border: none;
  border-radius: 8px !important;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
body.cx-auth .login-button:hover,
body.cx-auth .signup-container .signup-button:hover,
body.cx-auth .hospital-type-button:hover,
body.cx-auth .forgot-form .submit-button:hover {
  background: var(--cx-auth-accent-hover);
  color: #ffffff;
}
body.cx-auth .login-button:focus-visible,
body.cx-auth .signup-container .signup-button:focus-visible,
body.cx-auth .hospital-type-button:focus-visible,
body.cx-auth .forgot-form .submit-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--cx-focus);
}
body.cx-auth .login-button {
  font-size: 18px;
}

/* 보조 버튼(좌석 '다시 시도') — 인계보다 낮은 톤 */
body.cx-auth .login-button.seat-secondary {
  background: transparent;
  border: 1px solid var(--cx-line-strong);
  color: var(--cx-text);
}
body.cx-auth .login-button.seat-secondary:hover {
  background: var(--cx-hover);
  color: var(--cx-text);
}

/* 링크(비밀번호 찾기 · 회원가입 · 로그인 화면으로 · 로그아웃) */
body.cx-auth #forgot,
body.cx-auth #forgot:hover,
body.cx-auth .frame2-4 .signup-button,
body.cx-auth .frame2-4 .signup-button:hover,
body.cx-auth .actor-foot a,
body.cx-auth .reset-foot a {
  color: var(--cx-text-2);
}
body.cx-auth #forgot:hover,
body.cx-auth .frame2-4 .signup-button:hover,
body.cx-auth .actor-foot a:hover,
body.cx-auth .reset-foot a:hover {
  color: var(--cx-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
body.cx-auth .seperate {
  color: var(--cx-text-3);
}

/* 아이디 기억 */
body.cx-auth .frame2-3,
body.cx-auth .frame2-4 {
  color: var(--cx-text-2);
}
body.cx-auth input[id='remember'] + label {
  background-color: transparent;
  border: 1.5px solid var(--cx-text-3);
  vertical-align: -2px;
}
body.cx-auth input[id='remember']:checked + label {
  background-color: var(--cx-auth-accent);
  border-color: var(--cx-auth-accent);
}
/* [GOCDSS-6577] 키보드 초점 표시 — 감춘 체크박스 대신 동그라미 · 아이콘에, 링크는 글자 둘레에(마우스 클릭 때는 안 보임).
   모서리는 앱 전역 규칙(common.css * { border-radius: 0 !important })대로 각지게 */
body.cx-auth input[id='remember']:focus-visible + label,
body.cx-auth .terms-check:focus-visible + .terms-label i {
  box-shadow: 0 0 0 3px var(--cx-focus);
}
body.cx-auth #forgot:focus-visible,
body.cx-auth .frame2-4 .signup-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--cx-focus);
}

/* 안내 · 오류 문구 */
body.cx-auth .reset-hint,
body.cx-auth .actor-guide,
body.cx-auth .actor-account {
  color: var(--cx-text-2);
}
body.cx-auth .reset-invalid,
body.cx-auth .initial-password-desc,
body.cx-auth .actor-account strong {
  color: var(--cx-text);
}
body.cx-auth .reset-error,
body.cx-auth .actor-error {
  color: var(--cx-danger-text);
}

/* ── 개인 확인 — 사용자 선택(select) ────────────────────────────── */
body.cx-auth #actor-select {
  background-image: var(--cx-auth-select-arrow);
}
body.cx-auth #actor-select option {
  background-color: var(--cx-surface);
  color: var(--cx-text);
}

/* ── 좌석 안내 ────────────────────────────────────────────────────── */
body.cx-auth .seat-actor,
body.cx-auth .seat-usage-label,
body.cx-auth .seat-holders-title,
body.cx-auth .seat-waiting {
  color: var(--cx-text-2);
}
body.cx-auth .seat-usage,
body.cx-auth .seat-holder-list {
  border-color: var(--cx-line);
  background: var(--cx-surface-2);
}
body.cx-auth .seat-holder-list li {
  background: transparent;
}
body.cx-auth .seat-holder-list li + li {
  border-top-color: var(--cx-line);
}
body.cx-auth .seat-usage-count,
body.cx-auth .seat-holder-name {
  color: var(--cx-text);
}
body.cx-auth .seat-holder-meta {
  color: var(--cx-text-3);
}

/* ── 회사 정보(로그인 아래) — bottom-info.html 의 인라인 흰 글자 ──── */
body.cx-auth .bottom-area {
  background: var(--cx-surface);
  border-top: 1px solid var(--cx-line);
}
body.cx-auth .company-info {
  color: var(--cx-text-3) !important;
}

/* ── 회원가입(new-signup.mjs 가 그리는 단계 화면) ──────────────────── */
body.cx-auth .signup-box {
  background: var(--cx-surface);
  border: 1px solid var(--cx-line);
  border-radius: 14px !important;
  box-shadow: var(--cx-auth-card-shadow);
}
body.cx-auth .signup-header-main {
  color: var(--cx-text);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
body.cx-auth .signup-header-sub {
  color: var(--cx-text-2);
  font-size: 17px;
}
body.cx-auth .progress-circle {
  background-color: var(--cx-surface-3);
  color: var(--cx-text-2);
}
body.cx-auth .progress-circle.active {
  background-color: var(--cx-auth-accent);
  color: #ffffff;
}
body.cx-auth .input-frame p {
  color: var(--cx-text-2);
}
body.cx-auth .essential,
body.cx-auth .success,
body.cx-auth .terms-label i.active,
body.cx-auth .signup-icon-container.success {
  color: var(--cx-ok-text);
}
body.cx-auth .error,
body.cx-auth .time-limit,
body.cx-auth .signup-icon-container.fail {
  color: var(--cx-danger-text);
}
body.cx-auth .terms-label p {
  color: var(--cx-text);
}
body.cx-auth .terms-label i {
  color: var(--cx-text-3);
}
body.cx-auth .terms-link,
body.cx-auth .terms-link:hover {
  color: var(--cx-text-2);
}
body.cx-auth .terms-link:hover {
  text-decoration: underline;
}
body.cx-auth #authenticationCodeResend {
  background-color: var(--cx-auth-accent);
  color: #ffffff;
  border: none;
  border-radius: 8px !important;
}
body.cx-auth .url_description {
  background: var(--cx-warn-wash);
  color: var(--cx-warn-text);
  border: 1px solid var(--cx-warn-line);
  border-radius: 8px !important;
}
body.cx-auth .list-group-item {
  background-color: var(--cx-surface-2);
  color: var(--cx-text);
}
body.cx-auth .list-group-item:hover {
  background-color: var(--cx-surface-3);
}
body.cx-auth .niceCountryInputMenuDropdownContent,
body.cx-auth .niceCountryInputMenuFilter {
  background: var(--cx-surface);
  color: var(--cx-text);
  border: 1px solid var(--cx-line);
}
body.cx-auth .niceCountryInputMenuDropdownContent a {
  color: var(--cx-text);
}
body.cx-auth .niceCountryInputMenuDropdownContent a:hover {
  background: var(--cx-hover);
}

/* ── 비밀번호 찾기(forgot.html — 카드 없이 줄 하나였던 화면) ─────────── */
body.cx-auth .forgot-form .col-12 {
  max-width: 440px;
  margin: 0 auto;
  padding: 36px 32px;
  background: var(--cx-surface);
  border: 1px solid var(--cx-line);
  border-radius: 14px !important;
  box-shadow: var(--cx-auth-card-shadow);
}
body.cx-auth .forgot-form .col-sm-3 {
  padding: 0;
  flex: 0 0 100%;
  max-width: 100%;
}
body.cx-auth .forgot-form .form-row {
  margin-left: 0;
  margin-right: 0;
}
body.cx-auth .forgot-form h5 {
  color: var(--cx-text);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
body.cx-auth .forgot-form #email {
  height: 48px;
  padding: 0 16px;
}
body.cx-auth .forgot-form .submit-button {
  width: 100%;
  height: 48px;
}
body.cx-auth .forgot-form .alert-danger {
  background: var(--cx-danger-wash);
  color: var(--cx-danger-text);
  border: 1px solid var(--cx-danger-wash);
  border-radius: 8px !important;
}

/* ── 좁은 화면(모바일) — 카드를 화면 폭에 맞추고 테마 버튼은 아이콘만 ── */
@media (max-width: 640px) {
  body.cx-auth .frame {
    width: calc(100vw - 32px);
    padding: 24px 20px;
  }
  body.cx-auth .cx-theme-btn {
    padding: 0 9px;
  }
  body.cx-auth .cx-theme-btn-to-light,
  body.cx-auth .cx-theme-btn-to-dark,
  html[data-cx-theme='light'] body.cx-auth .cx-theme-btn-to-dark {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ── [GOCDSS-6561] 정렬 — 입력칸 · 주 버튼 같은 높이, 링크 누름 영역, 아이디 기억 줄 기준선 ──
   전에는 입력칸 52 · 주 버튼 64(재설정 화면은 입력도 64)로 화면마다 · 칸마다 높이가 달랐다.
   로그인 · 재설정 · 첫 비밀번호 · 공용 계정 선택(#actor-select 52) · 좌석 차단 모두 52 한 가지로 맞춘다. */
body.cx-auth .frame2-1 input,
body.cx-auth .frame2-2 input,
body.cx-auth .login-button {
  height: 52px;
}
/* login.css 좁은 화면의 버튼 위아래 안쪽 여백(23px)이 높이 52 안에서 글자를 밀지 않게 */
body.cx-auth .login-button {
  padding-top: 0;
  padding-bottom: 0;
}
/* 글자만 있던 링크(비밀번호 찾기 · 회원가입 · 로그인 화면으로)의 누름 영역 — 보이는 글자는 그대로, 높이 32(손가락 화면 40) */
body.cx-auth #forgot,
body.cx-auth .frame2-4 .signup-button {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}
@media (pointer: coarse) {
  body.cx-auth #forgot,
  body.cx-auth .frame2-4 .signup-button {
    min-height: 40px;
  }
}
/* 아이디 기억 ↔ 비밀번호 찾기 | 회원가입 — 한 줄 가운데 기준선(전에는 음수 여백으로 맞춰 약 3px 어긋났다).
   좁은 화면(767 이하)은 login.css 가 두 줄로 쌓으므로 넓은 화면에서만 */
@media (min-width: 768px) {
  body.cx-auth .frame2-3 {
    align-items: center;
  }
  body.cx-auth .frame2-3 .checkbox-title {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    margin: 0;
  }
  body.cx-auth .frame2-3 .frame2-4 {
    align-items: center;
    margin-top: 0;
  }
}
