/* -------- 공통 베이스 / 리셋(필요 최소) -------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  line-height: 1.5;
  color: #0f172a;               /* slate-900 */
  background: linear-gradient(180deg, #f8fafc, #eef2ff); /* slate-50 -> indigo-50 */
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
  body {
    color: #e5e7eb;             /* slate-200 */
    background: linear-gradient(180deg, #0b1220, #0f172a);
  }
}

/* -------- 레이아웃 -------- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.75);
}
@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(2, 6, 23, 0.65);
    border-bottom-color: rgba(226, 232, 240, 0.08);
  }
}

.site-nav {
  display: flex;
  align-items: center;
  height: 60px;
  gap: 12px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 140px;
  height: 60px;
  object-fit: contain;
}
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: .2px; }

/* 메인 영역: 가운데 정렬 */
.auth-wrap {
  min-height: calc(100dvh - 60px - 56px); /* header & footer 여백 고려 */
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

/* 카드 */
.auth-card {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(2,6,23,0.08), 0 2px 8px rgba(2,6,23,0.06);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: #ffffff;
  transition: transform .2s ease, box-shadow .2s ease;
}
.auth-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(2,6,23,0.12), 0 4px 16px rgba(2,6,23,0.08);
}
@media (prefers-color-scheme: dark) {
  .auth-card {
    background: rgba(2,6,23,0.6);
    border-color: rgba(226,232,240,0.08);
  }
}

/* 기존 클래스 재활용 */
.bg-white {
  width: 100%;
  background-color: rgba(255,255,255,0.9);
  border-bottom: 1px solid #e5e7ec;
  padding: 20px 24px;
  text-align: center;
}
@media (prefers-color-scheme: dark) {
  .bg-white {
    background-color: rgba(15,23,42,0.6);
    border-bottom-color: rgba(226,232,240,0.08);
  }
}
.text-title { font-size: 1.375rem; font-weight: 700; margin: 0; }

/* 본문(폼) */
.bg-grey {
  width: 100%;
  background-color: #f8fafc;
  padding: 20px 24px 24px;
  text-align: left;
}
@media (prefers-color-scheme: dark) {
  .bg-grey {
    background-color: rgba(15,23,42,0.4);
  }
}

/* 폼 공통 */
.field-group { margin: 12px 0 16px; position: relative; }
.label { display: inline-block; font-size: 0.9rem; margin-bottom: 8px; color: #334155; }
@media (prefers-color-scheme: dark) { .label { color: #cbd5e1; } }

.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: inherit;
  outline: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: #94a3b8; }
.input:focus {
  border-color: #6366f1; /* indigo-500 */
  box-shadow: 0 0 0 4px rgba(99,102,241,0.15);
}
@media (prefers-color-scheme: dark) {
  .input {
    background: rgba(2,6,23,0.6);
    border-color: rgba(148,163,184,0.25);
  }
  .input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(129,140,248,0.18);
  }
}

/* 액션 라인 */
.form-row {
  margin: 6px 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.checkbox { display: inline-flex; gap: 8px; align-items: center; font-size: 0.95rem; }
.link {
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: #4f46e5;
}
.link:hover { text-decoration-thickness: 2px; }

/* 버튼 */
/* 1) 버튼을 안정적으로 가운데 정렬 */
.btn-submit {
  display: inline-flex;              /* 텍스트 중앙 정렬 */
  align-items: center;
  justify-content: center;

  width: 100%;                       /* ✅ 기존처럼 카드 폭과 동일하게 */
  height: 48px;                      /* ✅ 고정 높이 */
  padding: 0 20px;                   /* 좌우 여유 */
  border-radius: 24px;
  border: 0;

  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;

  cursor: pointer;
  transition: transform .06s ease, filter .2s ease, box-shadow .2s ease;
  box-shadow: 0 6px 16px rgba(99,102,241,0.25);

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.btn-submit:hover { filter: brightness(1.05); }
.btn-submit:active { transform: translateY(1px); }
.btn-submit:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 4px rgba(99,102,241,0.25);
}



/* 알림/문구 */
.p_color { color: #ef4444; font-size: 0.95rem; }

/* 기존 black-nav → 현대화 헤더로 대체했지만, 하위호환 유지 */
.black-nav {
  background: #0f172a;
  color: #fff;
  width: 100%;
  display: flex;
  padding: 20px;
  font-weight: 600;
  font-size: 20px;
}

/* 푸터 */
.site-footer { padding: 24px 0 32px; text-align: center; color: #64748b; }
@media (prefers-color-scheme: dark) { .site-footer { color: #94a3b8; } }

/* 접근성: 모션 최소화 */
@media (prefers-reduced-motion: reduce) {
  .auth-card, .btn-submit { transition: none; }
}

.form-alert {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fee2e2;           /* red-100 */
  color: #991b1b;                /* red-800 */
  font-size: 0.95rem;
  border: 1px solid #fecaca;     /* red-200 */
}
@media (prefers-color-scheme: dark) {
  .form-alert {
    background: rgba(239,68,68,0.12);
    color: #fecaca;
    border-color: rgba(239,68,68,0.35);
  }
}