/* =============================================================
   auth.css — 인증 화면 공통 스타일
   대상: login.html / register.html
   ============================================================= */


/* -------------------------------------------------------------
   1. 전체 배경 / 중앙 정렬
   ------------------------------------------------------------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #FFF7EF 0%, #FBE7D8 100%);
  padding: 24px 16px;
  box-sizing: border-box;
}


/* -------------------------------------------------------------
   2. 카드 박스
   ------------------------------------------------------------- */
.auth-card {
  width: min(440px, 100%);
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 4px 6px rgba(217, 80, 47, 0.04),
    0 12px 32px rgba(217, 80, 47, 0.10);
  padding: 40px 36px 32px;
  box-sizing: border-box;
}


/* -------------------------------------------------------------
   3. 헤더 (제목 / 보조 설명)
   ------------------------------------------------------------- */
.auth-header {
  margin-bottom: 28px;
  text-align: center;
}

.auth-brand-logo {
  display: block;
  width: 260px;
  max-width: 80%;
  height: auto;
  object-fit: contain;
  margin: 0 auto 18px;
}

.auth-header h1 {
  margin: 0 0 8px;
  font-family: 'Gowun Batang', 'Noto Serif KR', serif;
  font-size: 23px;
  font-weight: 700;
  color: #2E2A26;
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.auth-header .auth-subtitle {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: #D9502F;
}

.auth-header p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
}


/* -------------------------------------------------------------
   4. 폼 공통 레이아웃
   ------------------------------------------------------------- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}


/* -------------------------------------------------------------
   5. 라벨
   ------------------------------------------------------------- */
.auth-form label {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}

.auth-form label:first-child {
  margin-top: 0;
}


/* -------------------------------------------------------------
   6. 입력 필드 (text / tel / password 공통)
   ------------------------------------------------------------- */
.auth-form input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 14px;
  color: #1e293b;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.auth-form input::placeholder {
  color: #94a3b8;
  font-size: 13px;
}

.auth-form input:focus {
  background: #ffffff;
  border-color: #F16B4E;
  box-shadow: 0 0 0 3px rgba(241, 107, 78, 0.15);
}


/* -------------------------------------------------------------
   7. 오류 메시지
   ------------------------------------------------------------- */
.error-msg {
  display: none; /* JS에서 style.display = 'block' 으로 노출 */
  margin: 6px 0 2px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  line-height: 1.5;
  white-space: pre-line; /* 오류코드/처리단계/진단번호 등 여러 줄 메시지의 줄바꿈 표시용 */
}


/* -------------------------------------------------------------
   8. 버튼 (로그인 / 회원가입 공통)
   ------------------------------------------------------------- */
.auth-form button {
  margin-top: 14px;
  width: 100%;
  height: 48px;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  background: #F16B4E;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 0.2px;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.auth-form button:hover {
  background: #D9502F;
  box-shadow: 0 4px 12px rgba(241, 107, 78, 0.30);
}

.auth-form button:active {
  background: #B5431F;
  transform: translateY(1px);
  box-shadow: none;
}


/* -------------------------------------------------------------
   9. 보조 링크 영역 (.auth-links)
   ------------------------------------------------------------- */
.auth-links {
  margin-top: 14px;
  text-align: center;
}

.auth-links a {
  font-size: 13px;
  color: #1F8A78;
  text-decoration: none;
  font-weight: 600;
}

.auth-links a:hover {
  color: #146D5E;
  text-decoration: underline;
}


/* -------------------------------------------------------------
   10. 안내 문구 (.hint)
   ------------------------------------------------------------- */
.hint {
  margin-top: 16px;
  padding: 12px 14px;
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  line-height: 1.7;
  word-break: keep-all;
}


/* -------------------------------------------------------------
   12. 필수 표시(*)
   ------------------------------------------------------------- */
.required-mark {
  color: #dc2626;
  margin-left: 2px;
  font-weight: 700;
}


/* -------------------------------------------------------------
   13. 약관 동의 구역 (사업자 규정 / 본인 동의) — register.html 전용
   ------------------------------------------------------------- */
.agreement-section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
}

.agreement-title {
  font-size: 14px;
  font-weight: 800;
  color: #2E2A26;
  margin-bottom: 8px;
}

.agreement-box {
  max-height: 220px;
  overflow-y: auto;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 12.5px;
  line-height: 1.8;
  color: #374151;
  word-break: keep-all;
  box-sizing: border-box;
}

.agreement-box:focus {
  outline: none;
  border-color: #F16B4E;
  box-shadow: 0 0 0 3px rgba(241, 107, 78, 0.15);
}

.agreement-box p {
  margin: 0 0 8px;
  font-weight: 700;
}

.agreement-box ol {
  margin: 0;
  padding-left: 18px;
}

.agreement-box li {
  margin-bottom: 8px;
}

.agreement-box li:last-child {
  margin-bottom: 0;
}

.agreement-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  line-height: 1.5;
  cursor: pointer;
  word-break: keep-all;
}

.agreement-checkbox input {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 1px;
  accent-color: #F16B4E;
  cursor: pointer;
}

.agreement-checkbox.field-invalid {
  color: #b91c1c;
}


/* -------------------------------------------------------------
   14. 서명 패드 (canvas + Pointer Events)
   ------------------------------------------------------------- */
.signature-block {
  margin-top: 16px;
}

.signature-title {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 4px;
}

.signature-hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

.signature-pad-wrap {
  width: 100%;
  max-width: 100%;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  overflow: hidden;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.signature-pad-wrap.field-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.signature-canvas {
  display: block;
  width: 100%;
  height: 160px;
  touch-action: none;   /* 서명 중 캔버스 영역이 페이지와 함께 스크롤되지 않도록 */
  cursor: crosshair;
}

.signature-canvas.signing {
  cursor: crosshair;
}

.signature-clear-btn {
  margin-top: 8px;
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.signature-clear-btn:hover {
  background: #eef2f7;
}

.signature-clear-btn:active {
  background: #e2e8f0;
}


/* -------------------------------------------------------------
   15. 반응형 — 모바일 (480px 이하)
   ------------------------------------------------------------- */
@media (max-width: 520px) {
  .auth-brand-logo {
    width: 220px;
    max-width: 85%;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 28px 20px 24px;
  }

  .auth-header h1 {
    font-size: 19px;
  }

  .auth-header .auth-subtitle {
    font-size: 14px;
  }

  .auth-header p {
    font-size: 12px;
  }

  .auth-form input {
    height: 44px;
    font-size: 14px;
  }

  .auth-form button {
    height: 46px;
    font-size: 14px;
  }

  .agreement-box {
    max-height: 170px;
    font-size: 12px;
    padding: 12px 14px;
  }

  .signature-canvas {
    height: 140px;
  }
}
