:root {
  color-scheme: light;
  --bg: #f6f3ed;
  --panel: #fffdf8;
  --text: #211d18;
  --muted: #72685d;
  --line: #ded5c8;
  --accent: #1f6f5b;
  --accent-strong: #155343;
  --danger: #9f2d20;
  --danger-bg: #fff0ed;
  --info-bg: #eef8f4;
  --shadow: 0 20px 45px rgba(47, 39, 29, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(145deg, rgba(31, 111, 91, 0.12), transparent 40%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 48px 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 6vw, 3.1rem);
  line-height: 1;
}

h2 {
  margin-bottom: 12px;
  font-size: 2rem;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-strong);
  font-weight: 700;
  padding: 8px 14px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.meta-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.meta-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.meta-grid strong {
  display: block;
  overflow-wrap: anywhere;
}

.notice {
  border-radius: 8px;
  margin: 18px 0;
  padding: 13px 14px;
}

.notice-error {
  background: var(--danger-bg);
  border: 1px solid rgba(159, 45, 32, 0.25);
  color: var(--danger);
}

.notice-info {
  background: var(--info-bg);
  border: 1px solid rgba(31, 111, 91, 0.22);
  color: var(--accent-strong);
}

.auth-card,
.success-card {
  padding-top: 24px;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  min-height: 48px;
  padding: 0 18px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.primary-button {
  width: 100%;
  background: var(--accent);
  color: white;
}

.secondary-button {
  background: #26211d;
  color: white;
}

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

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.divider {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 14px;
  margin: 24px 0;
  text-align: center;
}

.divider::before,
.divider::after {
  background: var(--line);
  content: "";
  flex: 1;
  height: 1px;
}

.field-label {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

.input-row,
.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 48px;
  padding: 0 14px;
  width: 100%;
}

input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(31, 111, 91, 0.18);
}

#success-username {
  font-size: 1.5rem;
  font-weight: 800;
}

.instruction {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 18px 0 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 620px) {
  .page-shell {
    padding: 18px 12px;
  }

  .panel {
    padding: 20px;
  }

  .panel-header,
  .input-row,
  .copy-row,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .panel-header {
    display: grid;
  }

  .status-pill {
    justify-self: start;
  }
}
