/* Login restyle. Loaded only by login_restyle.html.
   Black is the default. White is [data-theme="white"], the same attribute
   cos-theme.js sets. Tokens here are the ones cos-tokens.css does not define. */

:root {
  --font-display: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 6px;
  --background: oklch(0 0 0);
  --foreground: oklch(0.96 0.001 106);
  --surface: oklch(0.18 0 0);
  --surface-2: oklch(0.22 0 0);
  --card: oklch(0.155 0 0);
  --primary: oklch(0.505 0.209 27.9);
  --primary-foreground: oklch(0.98 0 0);
  --primary-deep: oklch(0.44 0.176 26.8);
  --muted: oklch(0.24 0 0);
  --muted-foreground: oklch(0.72 0 0);
  --border: oklch(0.28 0 0);
  --border-strong: oklch(0.38 0 0);
  --sx-red-text: oklch(0.74 0.16 27);
  --sx-focus: oklch(0.97 0.001 106);
  --panel: oklch(0.09 0 0);
  --grid: color-mix(in oklab, var(--border) 60%, transparent);
  color-scheme: dark;
}

html[data-theme="white"] {
  --background: oklch(0.985 0 0);
  --foreground: oklch(0.18 0 0);
  --surface: oklch(0.965 0 0);
  --surface-2: oklch(0.94 0 0);
  --card: oklch(1 0 0);
  --primary-foreground: oklch(0.99 0 0);
  --muted: oklch(0.94 0 0);
  --muted-foreground: oklch(0.38 0 0);
  --border: oklch(0.86 0 0);
  --border-strong: oklch(0.72 0 0);
  --sx-red-text: oklch(0.46 0.18 27);
  --sx-focus: oklch(0.18 0 0);
  --panel: oklch(0.965 0 0);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.25;
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
  font-weight: 700;
  margin: 0;
}

.logo-dark { display: block; }
.logo-light { display: none; }

[data-theme="white"] .logo-dark { display: none; }
[data-theme="white"] .logo-light { display: block; }

.mono { font-family: var(--font-mono); text-transform: uppercase; }

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

.page {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  min-height: 100vh;
}

.brand {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 40px 56px 36px;
}

.brand::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(120% 90% at 0% 100%, #000 25%, transparent 80%);
  mask-image: radial-gradient(120% 90% at 0% 100%, #000 25%, transparent 80%);
}

.brand::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
}

.brand > * { position: relative; }

.brand-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-top img { height: 26px; width: auto; }

.brand-body {
  margin-top: auto;
  margin-bottom: auto;
  max-width: 540px;
  padding: 40px 0;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sx-red-text);
}

.rule {
  display: block;
  width: 40px;
  height: 2px;
  background: var(--primary);
  margin-bottom: 18px;
}

.brand-title {
  font-size: 44px;
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin-top: 12px;
}

.brand-title em {
  font-style: normal;
  color: var(--sx-red-text);
}

[data-theme="white"] .brand-title em { color: var(--primary); }

.lede {
  margin: 16px 0 0;
  color: var(--muted-foreground);
  font-size: 15px;
  line-height: 1.5;
  max-width: 460px;
}

.features {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.feat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 13px;
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.feat::before {
  content: "";
  position: absolute;
  left: 14px;
  top: -1px;
  width: 22px;
  height: 2px;
  background: var(--primary);
}

.feat-ico {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sx-red-text);
  background: var(--surface);
}

.feat-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--muted-foreground);
}

.feat-title {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--foreground);
  line-height: 1.3;
}

.brand-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.auth {
  display: flex;
  flex-direction: column;
  padding: 28px 40px 32px;
  background: var(--background);
  min-width: 0;
}

.auth-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
  gap: 2px;
}

.seg button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: 4px;
}

.seg button[aria-pressed="true"] {
  background: var(--muted);
  color: var(--foreground);
}

.auth-mid {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
  min-width: 0;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 30px 32px 28px;
  box-shadow: 0 24px 64px -24px color-mix(in oklab, black 50%, transparent);
}

[data-theme="white"] .card {
  box-shadow: 0 20px 48px -28px color-mix(in oklab, black 22%, transparent);
}

.card h1 {
  font-size: 26px;
  line-height: 1.1;
  margin-top: 8px;
}

.card .sub {
  margin: 6px 0 0;
  color: var(--muted-foreground);
  font-size: 13px;
}

.flashes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.flash {
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in oklab, var(--primary) 55%, var(--border));
  background: color-mix(in oklab, var(--primary) 16%, var(--card));
  color: var(--foreground);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

form {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 7px;
}

.input {
  display: flex;
  align-items: center;
  min-height: 48px;
  height: 48px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0 4px 0 12px;
  gap: 10px;
  color: var(--muted-foreground);
}

.input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 14px;
}

.input input::placeholder {
  color: color-mix(in oklab, var(--muted-foreground) 80%, transparent);
}

.input input[type="password"] {
  letter-spacing: 0.18em;
  font-size: 15px;
}

.input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 22%, transparent);
}

.show {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  background: none;
  border: 0;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.check {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 2px;
  min-height: 44px;
  cursor: pointer;
}

.box {
  position: absolute;
  left: -14px;
  top: -14px;
  width: 44px;
  height: 44px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.box:focus { outline: none; }

.box-face {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.box:focus-visible + .box-face {
  outline: 2px solid var(--sx-focus);
  outline-offset: 2px;
}

.box:checked + .box-face {
  background: var(--primary);
  border-color: var(--primary);
}

.box:checked + .box-face::after {
  content: "";
  display: block;
  width: 4px;
  height: 8px;
  margin-top: -2px;
  border: solid var(--primary-foreground);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.check-label {
  font-size: 13px;
  color: var(--foreground);
  line-height: 1.3;
}

.check-note {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted-foreground);
}

.btn {
  min-height: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  margin-top: 4px;
}

.btn:hover {
  background: var(--primary-deep);
  border-color: var(--primary-deep);
}

.beta {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--primary);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 14px;
}

.beta .kicker { font-size: 10px; }

.beta p {
  margin: 5px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted-foreground);
}

.auth-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

/* 768px is a single column. Two columns are cramped below 1024. */
@media (max-width: 1023px) {
  .page { grid-template-columns: 1fr; }

  .brand {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 28px 28px 24px;
  }

  .brand-body {
    margin: 28px 0 0;
    padding: 0;
    max-width: 640px;
  }

  .brand-title { font-size: 34px; }

  .auth { padding: 20px 28px 28px; }

  .input input,
  .input input[type="password"] { font-size: 16px; }
}

@media (max-width: 760px) {
  .page { min-height: auto; }

  .brand {
    padding: 22px 20px;
  }

  .brand::after {
    width: auto;
    height: 2px;
    right: 0;
    bottom: auto;
  }

  .brand-top img { height: 20px; }

  .brand-body {
    padding: 20px 0 0;
    margin: 0;
  }

  .brand .rule,
  .lede,
  .features,
  .brand-foot { display: none; }

  .brand-title {
    font-size: 25px;
    line-height: 1.12;
    margin-top: 8px;
  }

  .auth { padding: 16px 16px 20px; }

  .auth-mid {
    padding: 14px 0 16px;
    align-items: flex-start;
  }

  .card {
    padding: 22px 20px 20px;
    max-width: none;
  }

  .card h1 { font-size: 22px; }

  form { margin-top: 18px; gap: 14px; }

  .beta { margin-top: 18px; }
}
