:root {
  --bg: #f1f0ee;
  --ink: #000000;
  --paper: #ffffff;
  --muted: #898989;
  --muted-2: #535353;
  --line: #cacaca;
  --accent: #ecf5bc;
  --blue: #1f5bff;
  --danger: #c62828;
  --font: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--blue);
}

.page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.page::after {
  content: "";
  position: absolute;
  width: min(560px, 70vw);
  height: min(560px, 70vw);
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(236, 245, 188, 0.85) 0%, rgba(236, 245, 188, 0) 68%);
  pointer-events: none;
  z-index: 0;
}

.top,
.auth {
  position: relative;
  z-index: 1;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 0;
  animation: rise 600ms var(--ease) both;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.logo img {
  display: block;
  height: 28px;
  width: auto;
}

.logo__text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.logo__text span {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--muted-2);
  letter-spacing: 0;
  margin-top: 2px;
}

.top__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.back-link {
  font-family: var(--mono);
  font-size: 11px;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

.auth-logout {
  height: 36px;
  padding: 0 12px;
  font-size: 12px;
}

.auth-session {
  display: grid;
  gap: 12px;
  margin: 4px 0 14px;
  padding: 14px;
  border: 1px solid var(--ink);
  background: var(--bg);
}

.auth-session[hidden] {
  display: none !important;
}

.auth-session__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted-2);
}

.auth-session__text strong {
  color: var(--ink);
  font-weight: 700;
}

.auth-session__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-session__actions .btn {
  height: 40px;
  padding: 0 14px;
  font-size: 12px;
  flex: 1 1 auto;
}

.panel.is-authed .tabs {
  display: none;
}

.panel.is-authed .panel__body {
  display: none;
}

.auth {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px 40px;
  animation: rise 700ms var(--ease) 60ms both;
}

.panel {
  width: min(100%, 1100px);
  background: var(--paper);
  border: 1px solid var(--ink);
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(0, 543fr) minmax(280px, 537fr);
  align-items: stretch;
  overflow: hidden;
}

.auth-card .actions .btn {
  width: 100%;
}

.auth-card__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
}

.auth-card__visual {
  position: relative;
  min-height: 596px;
  background: #ffffff;
  border-left: 1px solid #000;
}

.auth-card__visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.panel__head {
  padding: 40px 40px 0;
}

.panel__eyebrow {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
}

.panel__title {
  margin: 0;
  font-size: clamp(32px, 4vw, 50px);
  font-weight: 600;
  letter-spacing: -0.3px;
  line-height: 1;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 22px;
  border-bottom: 1px solid var(--line);
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.3px;
  padding: 14px 8px;
  cursor: pointer;
  color: var(--muted);
  position: relative;
}

.tab.is-active {
  color: var(--ink);
}

.tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--ink);
}

.panel__body {
  padding: 22px 40px 40px;
  max-height: min(62vh, 520px);
  overflow: auto;
  scrollbar-width: thin;
}

.page--auth .panel__body {
  max-height: min(68vh, 560px);
}

.auth-card .panel__eyebrow {
  display: none;
}

.form {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.form.is-active {
  display: flex;
  animation: fade 320ms var(--ease) both;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.2px;
  color: var(--muted-2);
}

.field__control {
  position: relative;
  display: flex;
  align-items: stretch;
}

.field__control .field__input {
  padding-right: 44px;
}

.field__toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 36px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #535353;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.field__toggle:hover,
.field__toggle:focus-visible {
  color: #000;
  outline: none;
}

.field__toggle[aria-pressed="true"] {
  color: #000;
}

.field__toggle-slash {
  opacity: 0;
  transition: opacity 140ms ease;
}

.field__toggle[aria-pressed="true"] .field__toggle-slash {
  opacity: 1;
}

.field__input {
  width: 100%;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.3px;
  padding: 0 12px;
  outline: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.field__input::placeholder {
  color: #b0b0b0;
  font-weight: 500;
}

.field__input:hover {
  background: #fcfcfb;
}

.field__input:focus {
  background: #fff;
  border-color: #000;
}

.field__input.is-invalid {
  border-color: var(--danger);
}

.field__hint {
  min-height: 14px;
  font-size: 11px;
  color: var(--danger);
  letter-spacing: -0.2px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: -0.2px;
  color: var(--muted-2);
  margin-top: 2px;
}

.check input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--ink);
}

.check a {
  font-weight: 600;
  color: #000;
  text-decoration: none;
  border-bottom: 1px solid #000;
}

.check a:hover {
  opacity: 0.75;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 0;
  height: 50px;
  padding: 0 18px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 160ms var(--ease), background-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: #000;
  color: #f5f5f5;
}

.btn--primary:hover {
  background: #111;
  color: #ecf5bc;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.btn--ghost:hover {
  background: var(--accent);
}

.btn__arrow {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1;
}

.form-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: -4px;
}

.form-meta a {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
}

.notice {
  display: none;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid var(--ink);
  background: var(--accent);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: -0.2px;
}

.notice.is-visible {
  display: block;
  animation: fade 280ms var(--ease) both;
}

.panel__note {
  margin: 16px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  line-height: 1.45;
}

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

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .auth-card {
    grid-template-columns: 1fr;
  }

  .auth-card__visual {
    min-height: 280px;
    border-left: 0;
    border-top: 1px solid #000;
    order: 2;
  }

  .panel__head {
    padding: 28px 24px 0;
  }

  .panel__body {
    padding: 18px 24px 28px;
    max-height: none;
  }
}

@media (max-width: 560px) {
  .top {
    padding: 18px 16px 0;
  }

  .logo__text {
    display: none;
  }

  .auth {
    justify-content: flex-start;
    padding-top: 24px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .panel__head,
  .panel__body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .panel__title {
    font-size: 28px;
  }

  .auth-card__visual {
    min-height: 220px;
  }
}
