/* ai.satorut.com sign-in — system fonts only, no external requests */
:root {
  --bg-top: #111829;
  --bg-bottom: #090d16;
  --card: #fbfbf9;
  --ink: #101828;
  --ink-soft: #3a4252;
  --muted: #667085;
  --line: #e4e6eb;
  --field: #ffffff;
  --field-line: #d5d9e1;
  --field-line-hover: #b9bfcb;
  --accent: #26408b;
  --accent-hover: #1e3473;
  --accent-ring: rgba(38, 64, 139, 0.18);
  --danger-ink: #8b2f26;
  --danger-bg: #fbf2f1;
  --danger-line: #efd3cf;
  --info-ink: #344054;
  --info-bg: #f2f4f7;
  --info-line: #e1e5ec;
  --radius: 16px;
  --radius-sm: 10px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--bg-bottom);
  background-image:
    radial-gradient(900px 520px at 50% -12%, rgba(110, 132, 186, 0.20), transparent 62%),
    radial-gradient(700px 420px at 50% 112%, rgba(38, 64, 139, 0.10), transparent 70%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.shell {
  min-height: 100vh;
  min-height: 100svh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: max(40px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom));
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px rgba(10, 14, 24, 0.55),
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 28px 64px -18px rgba(0, 0, 0, 0.60);
  padding: 36px 40px 40px;
  animation: rise 520ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* brand */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.mark {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: #f4f1ea;
  background: linear-gradient(160deg, #2f4c9e 0%, var(--accent) 55%, #1c3070 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 1px 2px rgba(16, 24, 40, 0.18);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: 0.005em; color: var(--ink); }
.brand-host {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* heading */
.intro { margin-bottom: 24px; }
.display {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.sub { margin: 0; color: var(--muted); font-size: 14.5px; }

/* state switching (works without JS: nginx serves a pre-rendered variant) */
.only-signed-out, .only-error, .only-locked { display: none; }
body[data-state="signed-out"] .only-signed-out { display: inline; }
body[data-state="signed-out"] .not-signed-out { display: none; }
body[data-state="signed-out"] .notice.only-signed-out,
body[data-state="error"] .notice.only-error,
body[data-state="locked"] .notice.only-locked { display: flex; }

/* notices */
.notice {
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 22px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-size: 13.5px;
  line-height: 1.45;
}
.notice svg { flex: none; margin-top: 1px; }
.notice-error { color: var(--danger-ink); background: var(--danger-bg); border-color: var(--danger-line); }
.notice-info  { color: var(--info-ink);   background: var(--info-bg);   border-color: var(--info-line); }

/* form */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; min-width: 0; }
label { font-size: 13px; font-weight: 600; color: var(--ink-soft); letter-spacing: 0.005em; }

input[type="email"], input[type="password"], input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  font: inherit;
  font-size: 16px; /* >=16px: no iOS zoom on focus */
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--field-line);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 1px rgba(16, 24, 40, 0.04);
  transition: border-color 140ms ease, box-shadow 140ms ease;
  -webkit-appearance: none;
  appearance: none;
  color-scheme: light;
}
input:hover { border-color: var(--field-line-hover); }
input:focus { outline: none; }
input:focus-visible, input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
input[aria-invalid="true"] { border-color: #d3a29b; }
input[aria-invalid="true"]:focus { border-color: var(--danger-ink); box-shadow: 0 0 0 4px rgba(139, 47, 38, 0.14); }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 68px; }
.reveal {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  height: 34px;
  padding: 0 10px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}
.reveal:hover { color: var(--ink); background: #f1f2f5; }
.reveal:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.reveal[hidden] { display: none; }

.caps { margin: 0; font-size: 12.5px; color: var(--muted); }
.caps[hidden] { display: none; }

.submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  margin-top: 6px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fbfaf7;
  background: var(--accent);
  border: 1px solid #1b2f68;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 1px 2px rgba(16, 24, 40, 0.16);
  cursor: pointer;
  transition: background-color 140ms ease, transform 80ms ease;
}
.submit:hover { background: var(--accent-hover); }
.submit:active { transform: translateY(1px); }
.submit:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.submit:disabled { cursor: progress; opacity: 0.82; transform: none; }

.spinner {
  display: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(251, 250, 247, 0.35);
  border-top-color: #fbfaf7;
  animation: spin 700ms linear infinite;
}
.submit.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* footer */
.foot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(214, 220, 232, 0.55);
}

/* small screens: 390px viewport -> 350px card, nothing wider than its container */
@media (max-width: 480px) {
  .shell { padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); gap: 18px; }
  .card { padding: 28px 22px 28px; }
  .brand { padding-bottom: 20px; margin-bottom: 22px; }
  .display { font-size: 27px; }
}
/* short viewports (landscape phones, on-screen keyboard): top-align so the form never hides */
@media (max-height: 640px) {
  .shell { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  input, .submit { transition: none; }
  .spinner { animation: none; border-color: rgba(251, 250, 247, 0.9); }
}

@media (forced-colors: active) {
  .submit, input, .card { border: 1px solid CanvasText; }
}
