:root {
  --auth-bg: #f7f0e4;
  --auth-card: rgba(255, 252, 246, 0.95);
  --auth-ink: #31261b;
  --auth-muted: #7b6a56;
  --auth-line: #dfc9a8;
  --auth-primary: #704513;
  --auth-primary-ink: #fff7ea;
  --auth-danger: #c83b29;
  --auth-success: #1f7a53;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--auth-ink);
  font-family: "Pretendard", "Noto Sans KR", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 12%, rgba(212, 160, 84, 0.22), transparent 30%),
    radial-gradient(circle at 90% 12%, rgba(105, 69, 30, 0.15), transparent 28%),
    linear-gradient(135deg, #fff9ef, var(--auth-bg));
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  padding: 32px 16px;
  place-items: center;
}

.auth-card {
  width: min(100%, 480px);
  padding: 34px;
  border: 1px solid var(--auth-line);
  border-radius: 24px;
  background: var(--auth-card);
  box-shadow: 0 22px 60px rgba(71, 50, 23, 0.14);
}

.auth-card-wide {
  width: min(100%, 760px);
}

.auth-eyebrow {
  margin: 0 0 10px;
  color: #9a5a13;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 56px);
  letter-spacing: 0;
}

.auth-copy,
.auth-link-copy,
.auth-help,
.auth-subcopy {
  color: var(--auth-muted);
}

.auth-copy {
  margin: 12px 0 24px;
}

.auth-form,
.auth-stage {
  display: grid;
  gap: 16px;
}

.auth-stage + .auth-stage {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dashed rgba(112, 69, 19, 0.18);
}

.auth-section-title {
  margin: 0;
  font-size: 20px;
}

.auth-subcopy {
  margin: -8px 0 0;
  font-size: 13px;
  font-weight: 700;
}

.auth-grid,
.auth-email-row {
  display: grid;
  gap: 14px;
}

.auth-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-email-row {
  grid-template-columns: minmax(0, 1fr) auto minmax(160px, 0.65fr);
  align-items: end;
}

.auth-inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.auth-at {
  padding-bottom: 14px;
  color: var(--auth-muted);
  font-weight: 800;
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--auth-line);
  border-radius: 14px;
  padding: 0 14px;
  color: var(--auth-ink);
  background: rgba(255, 255, 255, 0.86);
  font: inherit;
  font-weight: 600;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 4px rgba(112, 69, 19, 0.12);
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.auth-primary {
  background: var(--auth-primary);
  color: var(--auth-primary-ink);
}

.auth-secondary {
  border: 1px solid var(--auth-line);
  background: #efe1ca;
  color: var(--auth-ink);
}

.auth-alert {
  margin-bottom: 18px;
  border: 1px solid var(--auth-line);
  border-radius: 16px;
  padding: 13px 15px;
  background: #fff7eb;
  color: var(--auth-muted);
  font-weight: 700;
}

.auth-alert.error {
  border-color: rgba(200, 59, 41, 0.35);
  background: rgba(200, 59, 41, 0.08);
  color: var(--auth-danger);
}

.auth-alert.success,
.auth-help.success {
  color: var(--auth-success);
}

.auth-help {
  margin-top: -8px;
  font-size: 12px;
  font-weight: 700;
}

.auth-help.error {
  color: var(--auth-danger);
}

.auth-result-box {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(112, 69, 19, 0.2);
  border-radius: 16px;
  padding: 16px 18px;
  background: rgba(255, 250, 242, 0.8);
}

.auth-result-label {
  color: var(--auth-muted);
  font-size: 12px;
  font-weight: 800;
}

.auth-result-box strong {
  font-size: 22px;
}

.auth-actions,
.auth-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.auth-actions {
  align-items: center;
}

.auth-link-row {
  margin-top: 22px;
  justify-content: center;
}

.auth-text-link,
a {
  color: var(--auth-primary);
  font-weight: 900;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .auth-card {
    padding: 26px 20px;
    border-radius: 22px;
  }

  .auth-grid,
  .auth-email-row,
  .auth-inline-field {
    grid-template-columns: 1fr;
  }

  .auth-at {
    display: none;
  }
}
