/* Sign-in, help hub, and not-found pages. Builds on ui.css tokens. */
body {
  background:
    radial-gradient(circle at 9% 12%, var(--glow), transparent 27rem), var(--bg);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 40px));
  min-height: 80px;
  margin: auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
}
.brand img {
  width: 38px;
  height: 44px;
}
.brand-copy {
  display: grid;
  line-height: 1.1;
}
.brand-name {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 20px auto 34px;
}
.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(400px, 0.92fr);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.story-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(40px, 6vw, 72px);
  overflow: hidden;
  color: var(--navy-ink);
  background: var(--navy);
}
.story-panel::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(245, 196, 0, 0.11), transparent 50%),
    repeating-linear-gradient(
      135deg,
      transparent 0 42px,
      rgba(255, 255, 255, 0.025) 43px 44px
    );
  content: "";
}
.story-panel::after {
  position: absolute;
  right: -115px;
  bottom: -150px;
  width: 390px;
  height: 390px;
  border: 74px solid rgba(245, 196, 0, 0.13);
  border-radius: 50%;
  content: "";
}
.story-content,
.trust-list {
  position: relative;
  z-index: 1;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 18px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.eyebrow::before {
  width: 34px;
  height: 3px;
  background: currentColor;
  content: "";
}
.story-panel h1 {
  max-width: 650px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.3rem, 4vw, 4.2rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.story-panel .lead {
  max-width: 590px;
  margin: 24px 0 0;
  color: var(--navy-muted);
  font-size: clamp(1rem, 1.5vw, 1.14rem);
}
.story-panel strong {
  color: var(--navy-ink);
}
.trust-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
}
.trust-item {
  padding-top: 15px;
  border-top: 1px solid var(--navy-line);
  animation: ui-rise-in var(--motion-slow) var(--ease-out) 160ms backwards;
}
.trust-item:nth-child(2) {
  animation-delay: 220ms;
}
.trust-item:nth-child(3) {
  animation-delay: 280ms;
}
.trust-icon {
  display: grid;
  width: 32px;
  height: 32px;
  margin-bottom: 10px;
  place-items: center;
  border: 1px solid rgba(245, 196, 0, 0.55);
  border-radius: 9px;
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 800;
}
.trust-item span {
  display: block;
  color: var(--navy-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 5vw, 64px);
}
.form-panel-inner {
  width: min(100%, 440px);
  margin: auto;
  animation: ui-rise-in var(--motion-slow) var(--ease-out) 80ms backwards;
}
.form-panel h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.3rem);
  letter-spacing: -0.035em;
  line-height: 1.12;
}
.form-intro {
  margin: 12px 0 28px;
  color: var(--muted);
}
.stack {
  display: grid;
  gap: 20px;
}
.field {
  display: grid;
  gap: 8px;
}
/* Sits under the password box, aligned right. */
.forgot-link {
  justify-self: end;
  padding: 2px 0;
  font-size: 0.84rem;
  font-weight: 700;
}
label {
  font-size: 0.88rem;
  font-weight: 750;
}
.hint {
  color: var(--muted);
  font-size: 0.8rem;
}
input:not([type="checkbox"]) {
  width: 100%;
  height: var(--control-h);
  padding: 0 15px;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: var(--surface);
  font-size: 1rem;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}
input:not([type="checkbox"]):focus {
  border-color: var(--brand-border);
  box-shadow: var(--ring);
}
input[aria-invalid="true"] {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px var(--danger-tint) !important;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-border);
}

.button {
  display: inline-flex;
  min-height: var(--control-h);
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  color: var(--brand-ink);
  background: var(--brand);
  box-shadow: 0 7px 18px rgba(175, 137, 0, 0.18);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--motion-fast) var(--ease-out),
    background-color var(--motion-fast);
}
.button:hover {
  color: var(--brand-ink);
  background: var(--brand-hover);
}
/* Lift only with a real mouse; on touch screens it would stick after a tap. */
@media (hover: hover) and (pointer: fine) {
  .button:hover:not(:disabled) {
    transform: translateY(-1px);
  }
}
.button:disabled {
  opacity: 0.62;
  cursor: wait;
  transform: none;
}
.button.secondary {
  border-color: var(--field-border);
  color: var(--ink);
  background: var(--surface);
  box-shadow: none;
}
.button.secondary:hover {
  background: var(--hover);
}
.button.full {
  width: 100%;
}
.text-button {
  padding: 6px 4px;
  border: 0;
  color: var(--brand-text);
  background: none;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.signin-help {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}
.signin-help a {
  font-weight: 700;
}

.notice {
  display: flex;
  gap: 12px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink-2);
  background: var(--surface-2);
  font-size: 0.88rem;
}
.notice:not(.hidden) {
  animation: ui-rise-in var(--motion) var(--ease-out) 120ms backwards;
}
.notice strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
}
.notice-icon {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--info);
  font-size: 0.8rem;
  font-weight: 850;
}
.notice.success {
  border-color: var(--success-line);
  background: var(--success-tint);
}
.notice.success .notice-icon {
  background: var(--success);
}
.notice.warning {
  border-color: var(--warning-line);
  background: var(--warning-tint);
}
.notice.warning .notice-icon {
  background: var(--warning);
}
.notice.error {
  border-color: var(--danger-line);
  background: var(--danger-tint);
}
.notice.error .notice-icon {
  background: var(--danger);
}
#login-notice {
  margin-bottom: 22px;
}

.form-error {
  min-height: 20px;
  margin: -8px 0 0;
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 650;
}
.form-error:empty {
  min-height: 0;
  margin: -10px 0 0;
}
.footer-note {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}
.centered {
  text-align: center;
}
.centered .form-intro {
  max-width: 390px;
  margin-right: auto;
  margin-left: auto;
}

/* First sign-in dialog. */
.first-login-dialog {
  width: min(100% - 28px, 560px);
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 18px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.first-login-dialog::backdrop {
  background: var(--backdrop);
}
.first-login-card {
  padding: clamp(24px, 6vw, 40px);
  border-top: 5px solid var(--brand);
}
.first-login-card .eyebrow {
  color: var(--brand-text);
}
.first-login-card h2 {
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.first-login-card .form-intro {
  margin-bottom: 22px;
}
.first-login-card .password-rules {
  margin-top: -6px;
}
.first-login-cancel {
  justify-self: center;
}
.policy-acknowledgment {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--brand-line);
  border-radius: 12px;
  background: var(--brand-tint-2);
  font-size: 0.86rem;
  line-height: 1.6;
}
.policy-acknowledgment label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
}
.policy-acknowledgment input[type="checkbox"] {
  flex: 0 0 18px;
  margin: 3px 0 0;
}
.policy-acknowledgment a {
  color: var(--brand-text);
}
.policy-acknowledgment p,
.policy-acknowledgment small {
  margin: 0;
  color: var(--muted);
}

/* Account help hub (support.html). */
.help-options {
  display: grid;
  gap: 12px;
}
.help-option {
  animation: ui-rise-in var(--motion-slow) var(--ease-out) backwards;
}
.help-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
  transition:
    border-color var(--motion-fast),
    background-color var(--motion-fast),
    transform var(--motion-fast) var(--ease-out);
}
.help-option:hover {
  border-color: var(--brand-border);
  color: var(--ink);
  background: var(--brand-tint-2);
}
.help-option:active {
  transform: scale(0.985);
}
.help-option:nth-child(2) {
  animation-delay: 60ms;
}
.help-option:nth-child(3) {
  animation-delay: 120ms;
}
.help-option-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 12px;
  color: var(--brand-text);
  background: var(--brand-tint);
}
.help-option-icon svg {
  width: 22px;
  height: 22px;
}
.help-option strong {
  display: block;
  margin-bottom: 3px;
}
.help-option span span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}
.help-option-arrow {
  margin-left: auto;
  padding-top: 8px;
  color: var(--muted);
  transition: transform var(--motion-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .help-option:hover .help-option-arrow {
    color: var(--brand-text);
    transform: translateX(3px);
  }
}

@media (max-width: 900px) {
  .auth-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  /* The task comes first on smaller screens; the story follows it. */
  .form-panel {
    order: -1;
    padding: 36px 32px 40px;
  }
  .story-panel {
    padding: 36px 32px;
  }
  .story-panel h1 {
    font-size: clamp(1.9rem, 6vw, 2.8rem);
  }
  .trust-list {
    margin-top: 30px;
  }
}

@media (max-width: 560px) {
  .site-header,
  .page-shell {
    width: calc(100% - 24px);
  }
  .site-header {
    min-height: 64px;
  }
  .brand img {
    width: 32px;
    height: 37px;
  }
  .brand-subtitle {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
  }
  .page-shell {
    margin-top: 4px;
  }
  .auth-grid {
    border-radius: 18px;
  }
  .form-panel {
    padding: 28px 20px 32px;
  }
  .form-intro {
    margin-bottom: 22px;
  }
  .story-panel {
    padding: 28px 22px;
  }
  .story-panel .lead {
    margin-top: 16px;
    font-size: 0.95rem;
  }
  .trust-list {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 24px;
  }
  .trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 10px;
  }
  .trust-icon {
    flex: 0 0 32px;
    margin: 0;
  }
  .help-option {
    padding: 15px 14px;
  }
  .help-option-arrow {
    display: none;
  }
}
