:root {
  --bg: #100e0c;
  --bg-soft: #17130f;
  --panel: #1f1a15;
  --line: rgba(243, 232, 214, 0.1);
  --ink: #f3e8d6;
  --ink-dim: #c4b49d;
  --muted: #8f8170;
  --amber: #e8b44a;
  --danger: #e08a6a;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-ui: "Outfit", system-ui, sans-serif;
  --header-h: 4.15rem;
  --radius: 1.15rem;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

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

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

h1,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 80;
  padding: 0.65rem 0.9rem;
  border-radius: 0.6rem;
  background: var(--amber);
  color: #1a1308;
  font-weight: 600;
}

.skip:focus {
  top: calc(var(--safe-t) + 0.75rem);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.logo-mark {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

.logo em {
  font-style: italic;
  color: var(--amber);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.btn-primary {
  background: var(--amber);
  color: #1a1308;
  width: 100%;
}

.btn-primary:hover {
  background: #f0c264;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
  color: var(--amber);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 1.4rem;
  height: 1px;
  background: var(--amber);
}

.lede {
  margin-top: 0.85rem;
  color: var(--ink-dim);
}

.auth-top,
.app-header {
  min-height: var(--header-h);
  padding: calc(var(--safe-t) + 0.65rem) 1.15rem 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.auth-top-link {
  color: var(--ink-dim);
  font-weight: 600;
}

.auth-shell,
.app-main {
  width: min(100% - 2rem, 28rem);
  margin: 0 auto;
  padding: 2rem 0 calc(2.5rem + var(--safe-b));
}

.app-main {
  width: min(100% - 2rem, 40rem);
}

.auth-card {
  padding: 1.4rem 1.15rem 1.5rem;
  border-radius: 1.4rem;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top left, rgba(232, 180, 74, 0.12), transparent 40%),
    var(--panel);
}

.auth-card h1,
.app-main h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 8vw, 2.6rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.3rem;
}

.form label span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  color: var(--ink-dim);
}

.form input {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.7rem 0.95rem;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  background: #120f0c;
  color: var(--ink);
}

.form input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.form-status {
  margin-top: 1rem;
  font-size: 0.92rem;
}

.form-status.is-error {
  color: var(--danger);
}

.auth-switch {
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-switch a {
  color: var(--amber);
  font-weight: 600;
}

.empty-scratch {
  margin-top: 1.6rem;
  padding: 1.3rem 1.15rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-dim);
}

.app-header .btn-ghost {
  min-height: 2.55rem;
  padding-inline: 0.95rem;
}

@media (min-width: 720px) {
  .auth-shell {
    padding-top: 3.5rem;
  }

  .auth-card {
    padding: 2rem;
  }
}
