:root {
  --bg: #e9dcc7;
  --bg-accent: #ccb089;
  --panel: rgba(255, 252, 245, 0.95);
  --border: rgba(92, 62, 21, 0.18);
  --text: #231f19;
  --muted: #5f5648;
  --brand: #7a3f00;
  --brand-strong: #5d2f00;
  --brand-soft: #f0dfc7;
  --error-bg: #fde7e2;
  --error-text: #8d2c1f;
  --success-bg: #e7f3e3;
  --success-text: #2d6123;
  --shadow: 0 24px 60px rgba(62, 36, 8, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 245, 225, 0.85), transparent 32%),
    radial-gradient(circle at right, rgba(175, 109, 36, 0.12), transparent 28%),
    linear-gradient(160deg, var(--bg), #efe3cf 45%, #e6d3b9);
}

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

.panel {
  width: min(100%, 540px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 32px;
  backdrop-filter: blur(14px);
}

.panel-header {
  margin-bottom: 24px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.headline {
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 0.98;
}

.subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.stack {
  display: grid;
  gap: 16px;
}

.stack-inline {
  margin-top: 12px;
}

.actions-row {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(81, 61, 34, 0.18);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font-size: 16px;
  outline: none;
}

.field input:focus {
  border-color: rgba(122, 63, 0, 0.55);
  box-shadow: 0 0 0 4px rgba(122, 63, 0, 0.12);
}

.code-input {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", "JetBrains Mono", monospace;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-align: center;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  background: linear-gradient(180deg, #9a5614, var(--brand));
  color: #fffaf2;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 14px 28px rgba(122, 63, 0, 0.25);
}

.button:hover {
  transform: translateY(-1px);
}

.button-secondary {
  background: rgba(105, 74, 35, 0.08);
  color: var(--brand-strong);
  box-shadow: none;
  border: 1px solid rgba(105, 74, 35, 0.18);
}

.continue-link {
  text-decoration: none;
  text-align: center;
}

.flash {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
}

.flash-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.flash-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.meta {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}

.meta p {
  margin: 0;
}

.meta p + p {
  margin-top: 10px;
}

.text-link {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  color: var(--brand-strong);
  text-decoration: underline;
}

.card {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(111, 80, 39, 0.05);
  border: 1px solid rgba(111, 80, 39, 0.12);
}

.card-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.card-label {
  color: var(--muted);
  font-size: 14px;
}

.continue-state {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(111, 80, 39, 0.05);
  border: 1px solid rgba(111, 80, 39, 0.12);
}

.continue-copy {
  display: grid;
  gap: 6px;
}

.continue-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.continue-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(122, 63, 0, 0.16);
  border-top-color: var(--brand);
  animation: auth-spin 900ms linear infinite;
  flex-shrink: 0;
}

@keyframes auth-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .panel {
    padding: 24px;
    border-radius: 22px;
  }
}

@media (min-width: 641px) {
  .actions-row {
    grid-template-columns: 1fr 1fr;
  }
}
