:root {
  color-scheme: light;
  --account-bg: #f5f7f2;
  --account-surface: #ffffff;
  --account-ink: #10120f;
  --account-muted: #62685f;
  --account-line: #d8ddd3;
  --account-lime: #78e61f;
  --account-lime-soft: #e5ffd1;
  --account-danger: #b3261e;
  --account-shadow: rgba(56, 76, 42, 0.12);
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--account-bg);
  color: var(--account-ink);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(16, 18, 15, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16, 18, 15, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 84%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--account-lime);
  outline-offset: 3px;
}

.account-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(16, 18, 15, 0.12);
  background: rgba(245, 247, 242, 0.94);
  backdrop-filter: saturate(150%);
}

.account-nav,
.account-shell {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.account-nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.account-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: max-content;
  font-size: 16px;
  font-weight: 900;
}

.account-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  image-rendering: pixelated;
}

.account-brand span {
  display: block;
  line-height: 1;
}

.account-brand small {
  display: none;
}

.account-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-button {
  min-height: 44px;
  border: 1px solid var(--account-ink);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  cursor: pointer;
  background: transparent;
  color: var(--account-ink);
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.account-button:hover {
  transform: translateY(-2px);
}

.account-button:active {
  transform: translateY(0) scale(0.98);
}

.account-button.primary {
  background: var(--account-ink);
  color: #ffffff;
}

.account-button.accent {
  border-color: var(--account-lime);
  background: var(--account-lime);
  color: #102006;
}

.account-button:disabled {
  cursor: wait;
  opacity: 0.58;
  transform: none;
}

.account-shell {
  min-height: calc(100dvh - 73px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 470px);
  align-items: center;
  gap: clamp(52px, 9vw, 132px);
  padding-block: clamp(58px, 9vh, 104px);
}

.account-story {
  min-width: 0;
  max-width: 650px;
}

.auth-panel-label {
  color: var(--account-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.account-title {
  max-width: 640px;
  margin: 0;
  font-size: clamp(58px, 7.4vw, 104px);
  font-weight: 950;
  line-height: 0.86;
  text-transform: uppercase;
}

.account-title span {
  display: block;
  color: var(--account-lime);
}

.account-lead {
  max-width: 560px;
  margin: 28px 0 0;
  color: var(--account-muted);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.55;
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 38px;
  margin-bottom: 0;
  padding-left: 0;
  list-style: none;
}

[data-auth-page="login"] .provider-grid,
[data-auth-page="signup"] .provider-grid {
  margin-top: 0;
}

.provider-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--account-line);
  border-radius: 6px;
  background: var(--account-surface);
}

.provider-card-brand {
  width: 100%;
  height: 78px;
}

.provider-card-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px;
  background: #f8faf5;
}

.provider-card-brand > img {
  width: min(128px, 100%);
  height: 28px;
  object-fit: contain;
}

.provider-card-brand.openai-mark > img {
  width: 96px;
  height: 30px;
}

.provider-card-brand.llm-marks img {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.provider-card-copy {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--account-line);
  padding: 10px 12px;
}

.provider-card-copy strong,
.provider-card-copy span {
  min-width: 0;
}

.provider-card-copy strong {
  font-size: 12px;
  line-height: 1.2;
}

.provider-card-copy span {
  color: #4c9d13;
  font-size: 9px;
  font-weight: 900;
  text-align: right;
  text-transform: uppercase;
}

.auth-panel {
  min-width: 0;
  border: 1px solid var(--account-ink);
  border-radius: 8px;
  overflow: hidden;
  background: var(--account-surface);
  box-shadow: 14px 14px 0 var(--account-shadow);
  animation: panelEnter 560ms 80ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-panel-header {
  border-bottom: 1px solid var(--account-line);
  padding: 28px 30px 24px;
}

.auth-panel-label {
  color: #4c9d13;
}

.auth-panel h1,
.auth-panel h2 {
  margin: 10px 0 0;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 0.98;
}

.auth-panel-header p {
  margin: 12px 0 0;
  color: var(--account-muted);
  font-size: 14px;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 17px;
  padding: 26px 30px 30px;
}

.auth-form[hidden],
.auth-state[hidden] {
  display: none;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--account-muted);
  font-size: 12px;
  font-weight: 800;
}

.input-shell {
  position: relative;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--account-line);
  border-radius: 6px;
  padding: 12px 13px;
  outline: none;
  background: #fbfcfa;
  color: var(--account-ink);
  font-weight: 650;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input {
  min-height: 50px;
}

.field textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.5;
}

.field input.has-toggle {
  padding-right: 68px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #92988f;
}

.field input:focus,
.field textarea:focus {
  border-color: #4c9d13;
  background: var(--account-surface);
  box-shadow: 0 0 0 3px var(--account-lime-soft);
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  min-width: 46px;
  border: 0;
  padding: 6px;
  cursor: pointer;
  background: transparent;
  color: var(--account-muted);
  font-size: 11px;
  font-weight: 850;
  transform: translateY(-50%);
}

.field-hint,
.contact-line {
  color: var(--account-muted);
  font-size: 11px;
  line-height: 1.5;
}

.auth-submit {
  width: 100%;
  min-height: 51px;
  margin-top: 3px;
  font-size: 14px;
}

.auth-submit .button-progress {
  display: none;
}

.auth-submit.is-loading .button-label {
  display: none;
}

.auth-submit.is-loading .button-progress {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-submit.is-loading .button-progress::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.auth-message {
  display: none;
  border: 1px solid color-mix(in srgb, var(--account-danger) 44%, var(--account-line));
  border-radius: 6px;
  padding: 11px 12px;
  background: #fff5f4;
  color: var(--account-danger);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
}

.auth-message.is-visible {
  display: block;
}

.auth-message.success {
  border-color: #8bcf5b;
  background: var(--account-lime-soft);
  color: #2e7400;
}

.auth-switch {
  border-top: 1px solid var(--account-line);
  padding: 18px 30px;
  background: #fbfcfa;
  color: var(--account-muted);
  font-size: 13px;
  text-align: center;
}

.auth-switch a,
.contact-line a {
  color: var(--account-ink);
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: var(--account-lime);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

[data-auth-page="login"] .contact-line,
[data-auth-page="login"] .contact-line a {
  color: #9aa098;
}

[data-auth-page="login"] .contact-line a {
  font-weight: 750;
  text-decoration-color: #c8cdc5;
}

.auth-state {
  padding: 34px 30px;
}

.auth-state p {
  margin: 14px 0 24px;
  color: var(--account-muted);
  line-height: 1.55;
}

.account-story > * {
  animation: storyEnter 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.account-story .account-title {
  animation-delay: 50ms;
}

.account-story .account-lead {
  animation-delay: 100ms;
}

.account-story .provider-grid {
  animation-delay: 150ms;
}

@keyframes storyEnter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes panelEnter {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .account-shell {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 42px;
    padding-top: 54px;
  }

  .account-story {
    max-width: 720px;
  }

  .auth-panel {
    width: min(560px, 100%);
  }
}

@media (max-width: 620px) {
  .account-nav,
  .account-shell {
    width: calc(100% - 28px);
  }

  .account-nav {
    min-height: 66px;
  }

  .account-brand img {
    width: 34px;
    height: 34px;
  }

  .account-nav-actions .account-button:first-child {
    display: none;
  }

  .account-button {
    min-height: 42px;
    padding-inline: 14px;
  }

  .account-shell {
    min-height: calc(100dvh - 67px);
    gap: 34px;
    padding-block: 40px 54px;
  }

  .account-title {
    font-size: 38px;
  }

  .account-lead {
    margin-top: 20px;
    font-size: 16px;
  }

  .provider-grid {
    gap: 10px;
    margin-top: 28px;
  }

  .provider-card-brand {
    height: 66px;
  }

  .provider-card-copy {
    min-height: 58px;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .provider-card-copy span {
    text-align: left;
  }

  .auth-panel-header,
  .auth-form,
  .auth-state {
    padding-right: 20px;
    padding-left: 20px;
  }

  .auth-switch {
    padding-inline: 20px;
  }
}

@media (max-width: 360px) {
  .account-nav {
    gap: 12px;
  }

  .account-brand span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .account-header {
    background: var(--account-bg);
    backdrop-filter: none;
  }
}
