/* ─────────────────────────────────────────────────────────────
   Pathwave — Global Styles (Figma Design Guide 기반)
   ───────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Color Palette (Figma Design Guide) ── */
  --black:        #000000;
  --white:        #FFFFFF;
  --gray-100:     #F7F7F7;
  --gray-200:     #E4E4E4;
  --gray-300:     #DADADA;
  --gray-400:     #AAAAAA;
  --gray-500:     #971E84;
  --accent:       #FF00D6;
  --accent-light: #971E84;

  /* ── Semantic Colors ── */
  --bg:           #FFFFFF;
  --surface:      #FFFFFF;
  --surface2:     #F7F7F7;
  --border:       #E4E4E4;
  --border-focus: #000000;
  --text:         #000000;
  --text-muted:   #AAAAAA;
  --text-dim:     #DADADA;
  --success:      #22c55e;
  --error:        #f87171;
  --warning:      #fbbf24;

  /* ── Spacing & Radius ── */
  --radius:       8px;
  --radius-sm:    4px;
  --radius-lg:    12px;
  --shadow:       0 2px 12px rgba(0,0,0,.06);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.08);
}

html, body {
  height: 100%;
  font-family: 'Noto Sans KR', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Auth Wrapper ───────────────────────────────────────────── */
.auth-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Brand Panel (좌측 - 데스크탑용) ───────────────────────── */
.brand-panel {
  position: relative;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 48px;
  width: 440px;
  flex-shrink: 0;
}

.brand-content {
  position: relative;
  z-index: 2;
  max-width: 360px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 56px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 12px rgba(255,255,255,.3));
}

.logo-icon svg path:first-child {
  fill: url(#grad1);
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.5px;
  color: #fff;
}

.brand-headline {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -1px;
  margin-bottom: 16px;
  color: #fff;
}

.brand-desc {
  font-size: 14px;
  color: rgba(255,255,255,.55);
  line-height: 1.7;
  margin-bottom: 40px;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,.6);
  font-size: 13px;
  font-weight: 500;
  transition: color .2s;
}

.feature-item:hover { color: #fff; }

.feature-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  font-size: 15px;
  flex-shrink: 0;
}

.brand-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 80%, rgba(151,30,132,.15), transparent);
  z-index: 1;
}

.brand-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
}
.orb1 {
  width: 260px; height: 260px;
  background: rgba(151,30,132,.2);
  top: -80px; right: -80px;
  animation: orbFloat 10s ease-in-out infinite;
}
.orb2 {
  width: 180px; height: 180px;
  background: rgba(255,0,214,.1);
  bottom: -40px; left: -40px;
  animation: orbFloat 8s ease-in-out infinite reverse;
}

@keyframes orbFloat {
  0%,100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-16px) scale(1.03); }
}

/* ── Form Panel ─────────────────────────────────────────────── */
.form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 48px 32px;
  overflow-y: auto;
}

.form-container {
  width: 100%;
  max-width: 390px;
}

/* ── Progress Steps ─────────────────────────────────────────── */
.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 48px;
  gap: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gray-100);
  border: 1.5px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all .3s;
}

.step span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color .3s;
}

.step.active .step-num {
  background: var(--black);
  border-color: var(--black);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.step.active span { color: var(--black); font-weight: 600; }

.step.done .step-num {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.step.done span { color: var(--success); }

.step-line {
  flex: 1;
  height: 1.5px;
  background: var(--gray-200);
  min-width: 32px;
  margin: 0 6px;
  margin-bottom: 22px;
  transition: background .3s;
}
.step-line.active { background: var(--black); }

/* ── Form Step ──────────────────────────────────────────────── */
.form-step { animation: fadeIn .35s ease; }
.hidden { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-header {
  margin-bottom: 36px;
}
.step-header h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.5px;
  margin-bottom: 8px;
  color: var(--black);
}
.step-header p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.email-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 14px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  font-size: 13px;
  color: var(--black);
  font-weight: 500;
}

/* ── Input Group (Figma: 밑줄 인풋 스타일) ────────────────── */
.input-group {
  margin-bottom: 24px;
}
.input-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 10px;
  letter-spacing: 0;
  text-transform: none;
}
.input-wrapper {
  position: relative;
}
.input-icon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  stroke-width: 1.5;
  color: var(--text-muted);
  pointer-events: none;
  display: none;
}
.input-wrapper input {
  width: 100%;
  padding: 14px 0;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--gray-200);
  border-radius: 0;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.input-wrapper input::placeholder {
  color: var(--text-muted);
  font-size: 14px;
}
.input-wrapper input:focus {
  border-bottom-color: var(--black);
}
.input-wrapper input.error {
  border-bottom-color: var(--error);
}

/* ── Password Toggle ────────────────────────────────────────── */
.pw-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  opacity: .4;
  transition: opacity .2s;
  padding: 4px;
}
.pw-toggle:hover { opacity: .8; }

/* ── Password Strength ──────────────────────────────────────── */
.pw-strength-bar {
  height: 3px;
  background: var(--gray-200);
  border-radius: 100px;
  margin-top: 10px;
  overflow: hidden;
}
.pw-strength-fill {
  height: 100%;
  border-radius: 100px;
  width: 0;
  transition: width .4s ease, background .4s;
}
.pw-strength-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.pw-match-msg {
  font-size: 12px;
  margin-top: 6px;
  min-height: 16px;
  transition: color .2s;
}

/* ── Code Input ─────────────────────────────────────────────── */
.code-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}
.code-box {
  width: 48px; height: 56px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color .2s, box-shadow .2s, transform .1s;
  font-family: 'Inter', monospace;
}
.code-box:focus {
  border-color: var(--black);
  box-shadow: 0 0 0 2px rgba(0,0,0,.06);
  transform: scale(1.04);
}
.code-box.filled {
  border-color: var(--black);
  background: var(--gray-100);
}
.code-box.error {
  border-color: var(--error);
  animation: shake .4s ease;
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

/* ── Timer ──────────────────────────────────────────────────── */
.timer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.timer-text {
  font-size: 13px;
  color: var(--text-muted);
}
#timer {
  font-weight: 700;
  color: var(--black);
  font-variant-numeric: tabular-nums;
}
.resend-link {
  font-size: 13px;
  color: var(--black);
  text-decoration: underline;
  font-weight: 600;
  transition: opacity .2s;
}
.resend-link.disabled {
  color: var(--text-muted);
  pointer-events: none;
  cursor: default;
  text-decoration: none;
}

/* ── Error Message ──────────────────────────────────────────── */
.error-msg {
  min-height: 20px;
  font-size: 13px;
  color: var(--error);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: fadeIn .2s;
}

/* ── Buttons (Figma: 블랙 버튼 + 화이트 텍스트) ────────────── */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--black);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s, box-shadow .2s, background .2s;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  margin-bottom: 12px;
  letter-spacing: -.2px;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.06);
  opacity: 0;
  transition: opacity .2s;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: .35;
  cursor: not-allowed;
  transform: none !important;
}

.btn-ghost {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
  font-family: inherit;
}
.btn-ghost:hover { border-color: var(--black); color: var(--text); }

.btn-outline {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--error);
  border: 1.5px solid rgba(248,113,113,.3);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  font-family: inherit;
  margin-top: 8px;
}
.btn-outline:hover {
  background: rgba(248,113,113,.05);
  border-color: rgba(248,113,113,.5);
}

/* ── Loader ─────────────────────────────────────────────────── */
.btn-loader {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-loader.hidden { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Form Footer ────────────────────────────────────────────── */
.form-footer {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 12px;
}
.form-footer a {
  color: var(--black);
  text-decoration: none;
  font-weight: 700;
  margin-left: 4px;
  transition: opacity .2s;
}
.form-footer a:hover { opacity: .6; }

/* ── Success ────────────────────────────────────────────────── */
.success-container {
  text-align: center;
  padding: 24px 0;
}
.success-icon {
  width: 72px; height: 72px;
  margin: 0 auto 28px;
  animation: popIn .5s cubic-bezier(.34,1.56,.64,1);
}
.success-icon svg { width: 100%; height: 100%; }
.success-icon svg circle { stroke: var(--success); }
.success-icon svg path { stroke: var(--success); }

@keyframes popIn {
  from { transform: scale(.3); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.success-container h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--black);
}
.success-email {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}
.success-container p {
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.6;
  font-size: 14px;
}
.success-container .btn-primary { max-width: 260px; margin: 0 auto; }

/* ── Dashboard ──────────────────────────────────────────────── */
.dashboard { padding: 8px 0; }

.dashboard-avatar {
  width: 64px; height: 64px;
  background: var(--black);
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.dashboard h2 {
  text-align: center;
  font-size: 22px;
  margin-bottom: 6px;
  color: var(--black);
}

.dash-email {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.dash-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.dash-card:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow);
}

.dash-card-icon {
  font-size: 22px;
  width: 44px; height: 44px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
  color: var(--black);
}
.dash-card-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .auth-wrapper {
    flex-direction: column;
  }
  .brand-panel {
    display: none;
  }
  .form-panel {
    padding: 40px 24px;
  }
  .form-container {
    max-width: 100%;
  }
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 100px;
}

/* ── Focus visible ──────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}

input:focus-visible {
  outline: none;
}
