/* The sign-in page: the only page anyone can open. Same chart room as the app — lapis night,
   parchment, brass — and no saffron, because nothing here is the crew's. */
@font-face {
  font-family: 'Sahel';
  font-weight: 400 900;
  font-display: swap;
  src: url(/fonts/Sahel-VF.woff2) format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-weight: 300 900;
  font-display: swap;
  src: url(/fonts/Fraunces-normal-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/IBMPlexSans-400-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/IBMPlexSans-600-latin.woff2) format('woff2');
}

:root {
  --night: #0a1222;
  --lapis: #142039;
  --paper: #efe5cf;
  --paper-2: rgba(239, 229, 207, 0.74);
  --paper-3: rgba(239, 229, 207, 0.52);
  --line: rgba(239, 229, 207, 0.11);
  --line-2: rgba(239, 229, 207, 0.22);
  --brass: #b8925a;
  --brass-2: #dcb985;
  --seal: #d6452f;
  --seal-2: #ef6a4f;
  --ink: #12151c;
  --display: 'Fraunces', 'Sahel', Georgia, serif;
  --body: 'IBM Plex Sans', 'Sahel', system-ui, sans-serif;
  color-scheme: dark;
}
html[lang='fa'] {
  --display: 'Sahel', Tahoma, sans-serif;
  --body: 'Sahel', Tahoma, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
body {
  min-height: 100dvh;
  background:
    radial-gradient(1100px 700px at 50% 38%, rgba(38, 57, 95, 0.55), transparent 70%),
    var(--night);
  color: var(--paper);
  font: 15px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
html[lang='fa'] body {
  line-height: 1.85;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
}

.gate {
  position: relative;
  overflow: hidden;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 72px 16px 40px;
}

.rose {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(760px, 150vw);
  translate: -50% -50%;
  fill: none;
  stroke: var(--brass);
  stroke-width: 0.6;
  opacity: 0.16;
  pointer-events: none;
  animation: turn 240s linear infinite;
}
@keyframes turn {
  to {
    rotate: 360deg;
  }
}

.card {
  position: relative;
  width: min(420px, 100%);
  padding: 34px 30px 26px;
  border: 1px solid var(--line-2);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(20, 32, 57, 0.92), rgba(13, 23, 43, 0.92));
  box-shadow:
    0 40px 90px -40px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(239, 229, 207, 0.06);
  backdrop-filter: blur(6px);
  animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

h1 {
  margin: 26px 0 6px;
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.25;
}
.lede {
  margin: 0 0 24px;
  color: var(--paper-2);
  font-size: 0.93rem;
}

form {
  display: grid;
  gap: 16px;
}
.field {
  display: grid;
  gap: 6px;
}
.field > span:first-child {
  font-size: 0.84rem;
  color: var(--paper-2);
  font-weight: 500;
}
.input {
  width: 100%;
  height: 48px;
  padding-inline: 14px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.24);
  outline: none;
  font-family: 'IBM Plex Sans', 'Sahel', system-ui, sans-serif;
  transition:
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
}
.input:focus {
  border-color: var(--brass-2);
  background: rgba(0, 0, 0, 0.34);
  box-shadow: 0 0 0 4px rgba(184, 146, 90, 0.16);
}
.input[aria-invalid='true'] {
  border-color: var(--seal-2);
}

.pw {
  position: relative;
  display: block;
}
.pw .input {
  padding-inline-end: 48px;
}
.reveal {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 4px;
  width: 42px;
  display: grid;
  place-items: center;
  color: var(--paper-3);
  border-radius: 10px;
}
.reveal:hover,
.reveal[aria-pressed='true'] {
  color: var(--paper);
}

.error {
  margin: -4px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(214, 69, 47, 0.14);
  border: 1px solid rgba(239, 106, 79, 0.35);
  color: #ffd9cf;
  font-size: 0.88rem;
}

.btn {
  height: 50px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.98rem;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s,
    opacity 0.2s;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -14px rgba(0, 0, 0, 0.8);
}
.btn:active {
  transform: translateY(1px) scale(0.985);
}
.btn[disabled] {
  opacity: 0.55;
  pointer-events: none;
}
.btn.is-busy span::after {
  content: '…';
}

.note {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--paper-3);
  font-size: 0.82rem;
}

.lang {
  position: fixed;
  top: 16px;
  inset-inline-end: 16px;
  z-index: 2;
  height: 34px;
  min-width: 44px;
  padding-inline: 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--paper-2);
  font-size: 0.84rem;
  font-weight: 600;
}
.lang:hover {
  color: var(--paper);
  border-color: var(--paper-3);
}

:focus-visible {
  outline: 2px solid var(--brass-2);
  outline-offset: 2px;
}
.input:focus-visible {
  outline: none;
}

@media (max-width: 420px) {
  .card {
    padding: 28px 20px 22px;
    border-radius: 24px;
  }
  h1 {
    font-size: 1.45rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rose,
  .card {
    animation: none;
  }
}
