/* ASTRO sign-in app. Two looks: "mono" (black and white) and "rose" (pink and white).
   Every color is a token below. Contrast, measured against WCAG 2.2:
   mono  ink 19.7:1, muted 6.6:1, field edge 3.7:1 on white
   rose  ink 17.8:1, muted 6.9:1, field edge 4.0:1 on white; ink on the pink button 8.0:1 */

:root {
  --font: "Avenir Next", Avenir, "Century Gothic", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #ffffff;
  --ink: #0b0b0c;
  --muted: #5c5c63;
  --line: #e4e4e8;
  --edge: #85858d;
  --wash: #f4f4f6;
  --accent: #0b0b0c;
  --accent-2: #2b2b30;
  --on-accent: #ffffff;
  --focus: #0b0b0c;
  --halo: rgba(11, 11, 12, 0.14);
  --side: #0b0b0c;
  --on-side: #ffffff;
  --ring: rgba(255, 255, 255, 0.16);
  --star: rgba(255, 255, 255, 0.7);
  --err: #b42318;
  --err-bg: #fdecea;
  --swatch-edge: rgba(11, 11, 12, 0.3);
}
:root[data-theme="rose"] {
  --ink: #2a0f1b;
  --muted: #74505f;
  --line: #f3dbe4;
  --edge: #b06a85;
  --wash: #fdf0f4;
  --accent: #f291b2;
  --accent-2: #ee7fa6;
  --on-accent: #2a0f1b;
  --focus: #b0185a;
  --halo: rgba(176, 24, 90, 0.18);
  --side: #f8c6d7;
  --on-side: #2a0f1b;
  --ring: rgba(42, 15, 27, 0.16);
  --star: rgba(42, 15, 27, 0.55);
  --swatch-edge: rgba(42, 15, 27, 0.3);
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }

/* ---------- frame ---------- */
.as { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(320px, 40%) minmax(0, 1fr); }
.as-side {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--side); color: var(--on-side);
  padding: 40px 44px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; /* stays put while a long view scrolls */
  transition: background-color 0.35s ease, color 0.35s ease;
}
.as-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.as-mark { display: inline-block; color: inherit; border-radius: 6px; }
/* "by Alex Mitkov": the same lettering, as wide as the wordmark above it. The padding makes the link easy to tap. */
.as-by { display: block; margin: -8px 0; padding: 8px 0; color: inherit; opacity: 0.74; border-radius: 4px; transition: opacity 0.15s ease; }
.as-by:hover { opacity: 1; }
.as-by svg { display: block; width: 98px; height: auto; fill: currentColor; stroke: currentColor; stroke-width: 2.4; }
.as-by .as-stroke { stroke-width: 13.7; }
.as-mark svg { display: block; height: 22px; width: auto; fill: currentColor; }
.as-stroke { fill: none; stroke: currentColor; stroke-width: 11.3; }
.as-tag { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.72; }

/* the sky: four orbits around a point low on the panel, one of them carrying a planet */
.as-sky { position: absolute; z-index: -1; left: 62%; top: 64%; width: 0; height: 0; }
.as-ring { position: absolute; border: 1px solid var(--ring); border-radius: 50%; transform: translate(-50%, -50%); transition: border-color 0.35s ease; }
.as-ring-1 { width: 180px; height: 180px; }
.as-ring-2 { width: 380px; height: 380px; animation: as-orbit 120s linear infinite; }
.as-ring-2::after {
  content: ""; position: absolute; left: 50%; top: -6px; width: 11px; height: 11px; margin-left: -6px;
  border-radius: 50%; background: var(--on-side); transition: background-color 0.35s ease;
}
.as-ring-3 { width: 620px; height: 620px; }
.as-ring-4 { width: 900px; height: 900px; }
.as-star { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--star); }
.as-star-1 { left: -210px; top: -250px; }
.as-star-2 { left: 70px; top: -330px; width: 2px; height: 2px; }
.as-star-3 { left: -120px; top: 130px; width: 2px; height: 2px; }
.as-star-4 { left: -300px; top: -60px; }
.as-star-5 { left: 30px; top: -150px; width: 2px; height: 2px; }
@keyframes as-orbit { from { transform: translate(-50%, -50%) rotate(40deg); } to { transform: translate(-50%, -50%) rotate(400deg); } }

.as-main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; min-height: 100dvh; padding: 22px clamp(20px, 5vw, 56px) 26px; }
.as-bar { display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
.as-stage { flex: 1; display: grid; place-items: center; padding: 28px 0; }
.as-card { width: 100%; max-width: 392px; }
.as-foot { margin: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; font-size: 13px; color: var(--muted); text-align: center; }
.as-foot a { color: inherit; text-underline-offset: 3px; }
.as-lock { position: relative; width: 11px; height: 9px; margin-top: 4px; border-radius: 2px; background: currentColor; }
.as-lock::before { content: ""; position: absolute; left: 2px; top: -6px; width: 7px; height: 8px; border: 1.6px solid currentColor; border-bottom: 0; border-radius: 4px 4px 0 0; }
.as-wait { margin: 0; color: var(--muted); }
.as-noscript { position: fixed; inset: auto 0 0 0; margin: 0; padding: 14px 20px; background: var(--ink); color: var(--bg); text-align: center; }

/* ---------- bar: back and the look switch ---------- */
.as-back {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px 0 4px; margin-left: -4px;
  color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; border-radius: 10px;
}
.as-back::before { content: ""; width: 8px; height: 8px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-left: 4px; }
.as-back:hover { background: var(--wash); }
.as-look { display: flex; gap: 2px; margin-right: -10px; }
.as-look button { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; display: grid; place-items: center; cursor: pointer; }
.as-look button::before { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--swatch-edge); transition: box-shadow 0.15s ease; }
.as-look [data-as-look="mono"]::before { background: linear-gradient(90deg, #0b0b0c 50%, #ffffff 50%); }
.as-look [data-as-look="rose"]::before { background: linear-gradient(90deg, #f291b2 50%, #ffffff 50%); }
.as-look [aria-checked="true"]::before { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }

/* ---------- a view ---------- */
.as-view { animation: as-in 0.28s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes as-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.as-title { margin: 0; font-size: 34px; line-height: 1.08; font-weight: 600; letter-spacing: -0.022em; outline: none; }
.as-lead { margin: 10px 0 0; color: var(--muted); }
.as-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.as-switch { display: flex; align-items: baseline; gap: 24px; }
.as-switch button {
  padding: 0 0 7px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--edge);
  font: inherit; font-size: 34px; line-height: 1.08; font-weight: 600; letter-spacing: -0.022em; cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease; -webkit-tap-highlight-color: transparent;
}
.as-switch button:hover { color: var(--ink); }
.as-switch button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); cursor: default; }
.as-form { display: grid; gap: 16px; margin-top: 26px; }
.as-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.as-label label { font-size: 14px; font-weight: 600; }
.as-label .as-link { font-size: 14px; font-weight: 500; }
.as-input {
  display: block; width: 100%; height: 52px; padding: 0 14px;
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--edge); border-radius: 12px; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none; appearance: none;
}
.as-input::placeholder { color: var(--muted); opacity: 1; }
.as-input:hover { border-color: var(--ink); }
.as-input:focus { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus), 0 0 0 5px var(--halo); }
.as-input[aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 1px var(--err); }
.as-ferr { display: flex; align-items: flex-start; gap: 7px; margin: 7px 0 0; color: var(--err); font-size: 13px; font-weight: 500; }
.as-ferr::before { content: "!"; flex: none; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; background: var(--err); color: #ffffff; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; }
.as-code { letter-spacing: 0.12em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.as-pw { position: relative; }
.as-pw .as-input { padding-right: 74px; }
.as-show {
  position: absolute; right: 6px; top: 6px; height: 40px; min-width: 56px; padding: 0 10px;
  border: 0; border-radius: 8px; background: none; color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.as-show:hover { background: var(--wash); }
.as-hint { display: flex; justify-content: space-between; gap: 12px; margin: 7px 0 0; font-size: 13px; color: var(--muted); }
.as-count { font-variant-numeric: tabular-nums; white-space: nowrap; }
.as-count.is-ok { color: var(--ink); font-weight: 600; }

.as-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 52px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 12px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}
.as-btn:active { transform: scale(0.985); }
.as-btn-main { background: var(--accent); color: var(--on-accent); }
.as-btn-main:hover { background: var(--accent-2); }
.as-btn-line { background: var(--bg); color: var(--ink); border-color: var(--ink); }
.as-btn-line:hover { background: var(--wash); }
.as-btn[disabled] { opacity: 0.6; cursor: default; transform: none; }
.as-btn.is-busy::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: as-spin 0.7s linear infinite;
}
@keyframes as-spin { to { transform: rotate(360deg); } }
.as-key { position: relative; width: 18px; height: 18px; flex: none; }
.as-key::before { content: ""; position: absolute; left: 0; top: 3px; width: 10px; height: 10px; border: 2px solid currentColor; border-radius: 50%; }
.as-key::after { content: ""; position: absolute; left: 9px; top: 7px; width: 9px; height: 5px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; }

.as-or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 13px; }
.as-or::before, .as-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.as-form > .as-or { margin: 2px 0; }
.as-err { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--err-bg); color: var(--err); font-size: 14px; font-weight: 500; }
.as-err.is-quiet { background: var(--wash); color: var(--ink); }
.as-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 22px 0 0; font-size: 15px; color: var(--muted); }
.as-link {
  padding: 0; border: 0; background: none; color: var(--ink);
  font: inherit; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: pointer;
  display: inline-flex; align-items: center; min-height: 24px; border-radius: 4px;
}
.as-link:hover { text-decoration-thickness: 2px; }
.as-stack { display: grid; gap: 12px; margin-top: 26px; }
.as-flush { margin-top: 0; }
.as-note { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--wash); font-size: 14px; font-weight: 500; }

/* ---------- account ---------- */
.as-who { margin: 8px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.as-sec { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.as-sec h2 { margin: 0 0 4px; font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.as-rows { list-style: none; margin: 0; padding: 0; }
.as-rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.as-rows li:last-child { border-bottom: 0; }
.as-row-main { min-width: 0; }
.as-row-main b { display: block; font-weight: 600; }
.as-row-main span { display: block; font-size: 13px; color: var(--muted); }
.as-small { min-height: 40px; width: auto; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.as-sec > .as-btn, .as-sec > .as-form { margin-top: 12px; }
.as-end { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 15px; }
.as-danger { color: var(--err); }

/* ---------- keyboard focus ---------- */
.as-btn:focus-visible, .as-switch button:focus-visible, .as-link:focus-visible, .as-back:focus-visible, .as-show:focus-visible, .as-mark:focus-visible, .as-look button:focus-visible, .as-foot a:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 3px;
}
.as-side .as-mark:focus-visible, .as-by:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* ---------- phones and small tablets ---------- */
@media (max-width: 860px) {
  .as { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .as-side { position: relative; height: auto; flex-direction: row; align-items: center; min-height: 76px; padding: 0 20px; padding-top: env(safe-area-inset-top); }
  .as-brand { gap: 8px; }
  .as-mark svg { height: 20px; }
  .as-by svg { width: 89px; }
  .as-tag { font-size: 11px; }
  .as-sky { left: 86%; top: 150%; }
  .as-ring-3, .as-ring-4, .as-star { display: none; }
  .as-main { min-height: 0; padding: 12px 20px calc(22px + env(safe-area-inset-bottom)); }
  .as-stage { place-items: start center; padding: 22px 0 30px; }
  .as-title, .as-switch button { font-size: 30px; }
}
@media (max-width: 360px) { .as-tag { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .as-ring-2, .as-view, .as-btn.is-busy::before { animation: none; }
  .as-ring-2 { transform: translate(-50%, -50%) rotate(40deg); }
  * { transition: none !important; }
}
@media (forced-colors: active) {
  .as-btn, .as-input { border: 1px solid ButtonText; }
  .as-look [aria-checked="true"]::before { outline: 2px solid Highlight; outline-offset: 2px; }
}
