:root {
  color-scheme: light;
  --background: #f4f6fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #697386;
  --line: #e7eaf0;
  --brand: #635bff;
  --brand-hover: #5148d8;
  --danger: #b42318;
  --success: #067647;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.auth-shell,
.loading-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-shell {
  background:
    radial-gradient(circle at 20% 10%, #dedcff, transparent 35%),
    radial-gradient(circle at 90% 90%, #d9f7eb, transparent 35%),
    #f7f8fc;
}

.auth-card,
.placeholder-card {
  width: min(430px, 100%);
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(30, 41, 59, 0.15);
}

.auth-card {
  text-align: center;
}

.logo {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), #9b8afb);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}

h1 {
  margin: 0 0 8px;
}

p {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 16px;
  margin-top: 26px;
  text-align: left;
}

.stack label {
  font-size: 13px;
  font-weight: 700;
}

.stack input {
  width: 100%;
  margin-top: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}

.stack input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.1);
}

.primary,
.ghost {
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 750;
}

.primary {
  border: 0;
  background: var(--brand);
  color: #fff;
}

.primary:hover {
  background: var(--brand-hover);
}

.primary:disabled {
  cursor: wait;
  opacity: 0.65;
}

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.message {
  margin: 18px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: #fef3f2;
  color: var(--danger);
  text-align: left;
}

.message[hidden] {
  display: none;
}

.auth-card.wide {
  width: min(650px, 100%);
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.uppercase {
  text-transform: uppercase;
}

.auth-card a {
  display: inline-block;
  margin-top: 20px;
  color: var(--brand);
}

.topbar {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 14px max(24px, calc((100vw - 1240px) / 2));
  background: #111827;
  color: #fff;
}

.brand {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 16px;
}

.userbox span {
  display: grid;
  text-align: right;
}

.userbox small {
  color: #aeb7c8;
}

.page-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 42px 24px 80px;
}

.placeholder-card {
  width: 100%;
  text-align: left;
}

.loading {
  color: var(--muted);
  font-weight: 700;
}

.pwa-update {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 36px);
  padding: 13px 14px 13px 16px;
  border: 1px solid #3b4557;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.28);
}

.pwa-update button {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 750;
}

@media (max-width: 640px) {
  .auth-card,
  .placeholder-card {
    padding: 30px 22px;
  }

  .userbox span {
    display: none;
  }

  .grid2 {
    grid-template-columns: 1fr;
  }
}
