/* ============================================================
 * auth.css — 로그인 / 가입신청 / 비밀번호변경 공통
 * ============================================================ */

/* ─────────────────────────────────────────────────────────────
 * 로그인 — 2컬럼 레이아웃
 * ───────────────────────────────────────────────────────────── */
body.auth-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: #f0f2f5;
  display: flex;
  align-items: stretch;
}

.auth-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* 좌측 브랜드 패널 */
.auth-panel {
  width: 340px;
  min-width: 340px;
  background: #0a1e3d;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  position: relative;
  overflow: hidden;
}

/* 배경 장식 */
.auth-panel::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.10);
  pointer-events: none;
}

.auth-panel::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.06);
  pointer-events: none;
}

.auth-panel-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  justify-content: center;
}

.auth-panel-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.auth-panel-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.auth-panel-brand-text {
  line-height: 1.25;
}

.auth-panel-title {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.auth-panel-subtitle {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 4px;
  letter-spacing: -0.01em;
}



/* 우측 폼 패널 */
.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: #f0f2f5;
}

.auth-form-wrap {
  width: 100%;
  max-width: 380px;
}

.auth-form-header {
  margin-bottom: 28px;
}

.auth-form-title {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.auth-form-sub {
  font-size: 13px;
  color: #6b7280;
}

/* 폼 */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-field label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap i {
  position: absolute;
  left: 11px;
  font-size: 15px;
  color: #9ca3af;
  pointer-events: none;
}

.auth-input-wrap input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 36px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: #111827;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input-wrap input:hover {
  border-color: #9ca3af;
}

.auth-input-wrap input:focus {
  border-color: #2f6df6;
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.12);
}

.auth-input-wrap input::placeholder { color: #9ca3af; }

/* 메시지 */
.auth-message {
  min-height: 18px;
  font-size: 12px;
  line-height: 1.5;
}
.auth-message:empty { min-height: 0; }

.auth-message.is-error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 10px 12px;
  font-weight: 500;
}
.auth-message.is-success {
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 10px 12px;
  font-weight: 500;
}

/* 로그인 버튼 */
.auth-btn {
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 6px;
  background: #0c1f3f;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}

.auth-btn:hover   { background: #0a1a35; }
.auth-btn:active  { transform: scale(0.99); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 하단 링크 */
.auth-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
  text-align: center;
}

.auth-links a {
  color: #2f6df6;
  font-weight: 600;
  text-decoration: none;
}

.auth-links a:hover { text-decoration: underline; }

/* 캐시 초기화 */
.auth-cache-reset {
  text-align: center;
}

.auth-cache-reset button {
  background: none;
  border: none;
  font-size: 11px;
  color: #9ca3af;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s;
}

.auth-cache-reset button:hover { color: #6b7280; }
.auth-cache-reset button i { font-size: 12px; }

/* ─────────────────────────────────────────────────────────────
 * 가입신청 페이지
 * ───────────────────────────────────────────────────────────── */

/* register.html은 auth-page + auth-shell + auth-card 구조 유지 */
.auth-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 28px;
}

/* 브랜드 헤더 */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f3f4f6;
}

.auth-brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: linear-gradient(135deg, #22c55e, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
}

.auth-brand-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
}

.auth-brand-text span {
  display: block;
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
}

/* 제목 */
.auth-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.auth-desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.55;
  margin-bottom: 18px;
}

/* 가입 폼 */
.reg-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* field-group (공통 — common.css와 연동) */
.auth-card .field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-card .field-group label,
.auth-card .form-label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 5px;
}

.auth-card .field-group input,
.auth-card .field-group select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: #111827;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.auth-card .field-group select {
  background-image: 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 1l5 5 5-5' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

.auth-card .field-group input:focus,
.auth-card .field-group select:focus {
  border-color: #2f6df6;
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.12);
}

.auth-card .field-group input::placeholder { color: #9ca3af; }

.auth-card .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-card .form-help {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}

/* 구분선 */
.auth-card .divider {
  border: none;
  border-top: 1px solid #f3f4f6;
  margin: 2px 0;
}

/* 필드 뱃지 */
.field-badge {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.field-badge.required { background: #fef2f2; color: #dc2626; }
.field-badge.optional { background: #f3f4f6; color: #6b7280; }

/* 제출 버튼 */
.submit-btn {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 6px;
  background: #0c1f3f;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}

.submit-btn:hover   { background: #13203f; }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 로그인 링크 */
.login-link {
  text-align: center;
  font-size: 12px;
  color: #6b7280;
}

.login-link a {
  color: #2f6df6;
  font-weight: 600;
  text-decoration: none;
}

.login-link a:hover { text-decoration: underline; }

/* 완료 상태 */
.success-state {
  display: none;
  text-align: center;
  padding: 20px 0;
}

/* ─────────────────────────────────────────────────────────────
 * 비밀번호 변경 페이지
 * ───────────────────────────────────────────────────────────── */
.change-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: #f0f2f5;
}

.change-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 28px;
}

.change-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}

.change-desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f3f4f6;
}

.change-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.change-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.change-field label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.change-field input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: #111827;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.change-field input:focus {
  border-color: #2f6df6;
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.12);
}

.change-field input::placeholder { color: #9ca3af; }

.change-hint {
  font-size: 11px;
  color: #9ca3af;
}

.change-btn {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 6px;
  background: #0c1f3f;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}

.change-btn:hover   { background: #13203f; }
.change-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ─────────────────────────────────────────────────────────────
 * 반응형
 * ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* 로그인 — 세로 스택 */
  .auth-layout {
    flex-direction: column;
  }

  .auth-panel {
    width: 100%;
    min-width: 0;
    padding: 20px 24px;
  }

  .auth-panel-title { font-size: 20px; }
  .auth-panel-apps  { margin-top: 12px; }

  .auth-form-panel {
    flex: none;
    padding: 28px 20px 40px;
    align-items: flex-start;
  }

  .auth-form-wrap { max-width: none; }

  /* 가입신청 */
  .auth-card .form-row { grid-template-columns: 1fr; }
  .auth-card { padding: 22px; }
}

@media (max-width: 480px) {
  .auth-panel { padding: 16px 20px; }
  .auth-form-panel { padding: 24px 16px 36px; }
  .auth-card { padding: 18px; border-radius: 8px; }
  .change-card { padding: 22px; border-radius: 8px; }
}


/* 휴대폰 로그인: 위쪽 브랜드 영역을 화면의 약 40%로 키우고, 아래 입력 영역은 둥근 시트로 겹쳐 올려
   화면 끝까지 채운다(예전에는 내용이 위로 몰리고 아래가 비어 보였다). */
@media (max-width: 768px) {
  body.auth-page { min-height: 100vh; min-height: 100dvh; background: #fff; }
  .auth-layout { min-height: 100vh; min-height: 100dvh; }
  .auth-layout > .auth-panel {
    flex: 0 0 auto;
    height: 40vh; height: 40dvh; min-height: 190px; max-height: 360px;
    padding: 24px 24px 48px;          /* 아래 시트가 겹쳐 올라오는 만큼 로고를 위로 */
  }
  .auth-layout > .auth-panel .auth-panel-logo-img { width: 240px; max-width: 72%; }
  .auth-layout > .auth-form-panel {
    flex: 1 0 auto;
    position: relative; z-index: 2;
    margin-top: -28px;
    background: #fff;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -6px 24px rgba(10, 30, 61, .12);
    padding: 26px 22px calc(28px + env(safe-area-inset-bottom));
    align-items: stretch;
  }
  .auth-layout > .auth-form-panel .auth-form-wrap { width: 100%; }
  .auth-layout > .auth-form-panel .auth-btn { height: 50px; font-size: 16px; border-radius: 10px; }
  .auth-layout > .auth-form-panel .auth-input-wrap input { height: 48px; border-radius: 10px; }
  .auth-layout > .auth-form-panel .auth-field { margin-bottom: 16px; }
  .auth-layout > .auth-form-panel .auth-tab { white-space: nowrap; padding: 10px 4px; }
}
/* 세로가 짧은 휴대폰(아이폰 SE 등)은 브랜드 영역을 줄여 입력칸이 넉넉히 보이게 */
@media (max-width: 768px) and (max-height: 720px) {
  .auth-layout > .auth-panel { height: 30vh; height: 30dvh; min-height: 150px; }
  .auth-layout > .auth-form-panel .auth-tab { font-size: 13px; }
}

/* 로고 이미지 — 패널 중앙에 자연스럽게 배치 */
.auth-panel-logo-img {
  display: block;
  width: 260px;
  max-width: 90%;
  height: auto;
  margin: 0 auto;
}

/* 휴대폰으로 사이트 주소에 바로 들어오면 모바일 로그인(mobile/index.html)이 아니라 이 화면이 뜬다.
   아이폰 사파리는 16px 미만 입력칸에 포커스가 가면 화면을 자동 확대하므로,
   손가락이 주 입력인 기기에서만 입력칸 글자를 16px로 올린다(PC 화면 모양은 그대로). (MSO와 같은 수정) */
@media (pointer: coarse) {
  .auth-page input:not([type="checkbox"]):not([type="radio"]),
  .auth-page select,
  .auth-page textarea {
    font-size: 16px;
  }
}
