/* Sign-in pages, shared layout (allauth/layouts/base.html). A file and not an inline <style>: the pages'
   Content-Security-Policy allows no inline style (backend/middleware.py). */
:root {
  color-scheme: light;
  --canvas: #f4efe7;
  --canvas-shadow: #e2d5c3;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --surface-muted: rgba(255, 255, 255, 0.58);
  --line: rgba(15, 35, 57, 0.1);
  --ink: #102339;
  --ink-soft: #566576;
  --ink-soft-strong: #41505f;
  --brand: #163451;
  --brand-strong: #0d2740;
  --brand-warm: #c29b66;
  --success: #1f6f57;
  --success-bg: rgba(31, 111, 87, 0.08);
  --success-line: rgba(31, 111, 87, 0.14);
  --info: #44576b;
  --info-line: rgba(16, 35, 57, 0.1);
  --info-soft-bg: rgba(16, 35, 57, 0.04);
  --danger: #8d342f;
  --danger-bg: rgba(174, 74, 64, 0.08);
  --danger-line: rgba(148, 61, 54, 0.14);
  --info-bg: rgba(216, 228, 242, 0.52);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --shadow-lg: 0 32px 90px -46px rgba(16, 35, 57, 0.42);
  --shadow-md: 0 18px 36px -26px rgba(16, 35, 57, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter Variable", "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(18, 52, 80, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(194, 155, 102, 0.22), transparent 24%),
    linear-gradient(140deg, #faf7f1 0%, var(--canvas) 52%, var(--canvas-shadow) 100%);
}

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

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
}

.stage,
.panel-wrap {
  padding: 38px;
}

.stage {
  display: flex;
  align-items: stretch;
}

.stage-card {
  width: 100%;
  min-height: 100%;
  border-radius: var(--radius-xl);
  padding: 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lg);
  background:
    linear-gradient(180deg, rgba(14, 37, 59, 0.96), rgba(20, 53, 83, 0.93)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent);
  color: #f7f9fc;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

.stage-card::after {
  content: "";
  position: absolute;
  inset: auto -10% -18% auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(194, 155, 102, 0.22), transparent 68%);
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.06em;
}

.brand-copy {
  display: grid;
  gap: 5px;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(247, 249, 252, 0.64);
}

.headline {
  max-width: 10ch;
  margin: 44px 0 0;
  font-size: clamp(3rem, 4.2vw, 5.2rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.lede {
  max-width: 34rem;
  margin: 24px 0 0;
  font-size: 17px;
  line-height: 1.82;
  color: rgba(247, 249, 252, 0.8);
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 36px;
}

.signal {
  padding: 18px 18px 17px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.signal-kicker {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(247, 249, 252, 0.64);
}

.signal-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(247, 249, 252, 0.84);
}

.stage-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  font-size: 13px;
  color: rgba(247, 249, 252, 0.68);
}

.stage-foot-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand-warm);
  box-shadow: 0 0 0 5px rgba(194, 155, 102, 0.14);
}

.panel-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel {
  width: min(560px, 100%);
  border-radius: 30px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(250, 247, 241, 0.88)),
    linear-gradient(180deg, var(--surface), var(--surface-muted));
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  padding: 36px;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7f6850;
}

.panel-title {
  margin: 16px 0 0;
  font-size: 2.3rem;
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.panel-copy {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.78;
}

.panel-body {
  margin-top: 28px;
}

.panel-body h1 {
  margin: 0 0 12px;
  font-size: 2rem;
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.panel-body h2 {
  margin: 0 0 12px;
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.panel-body p,
.panel-body li,
.panel-body label {
  color: var(--ink-soft-strong);
  font-size: 14px;
  line-height: 1.7;
}

.panel-body ul {
  margin: 0;
  padding-left: 20px;
}

.panel-body a {
  color: var(--brand);
  font-weight: 600;
}

.auth-stack,
.action-stack {
  display: grid;
  gap: 16px;
}

.auth-form {
  margin: 0;
  display: grid;
  gap: 14px;
}

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

.field label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft-strong);
}

.field-input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(16, 35, 57, 0.16);
  background: var(--surface-strong);
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field-input:focus {
  outline: none;
  border-color: rgba(22, 52, 81, 0.55);
  box-shadow: 0 0 0 4px rgba(22, 52, 81, 0.1);
}

.password-wrapper {
  position: relative;
}

.password-wrapper .field-input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.password-toggle:hover {
  background: rgba(16, 35, 57, 0.06);
  color: var(--ink);
}

.password-toggle:focus-visible {
  outline: 2px solid rgba(22, 52, 81, 0.55);
  outline-offset: 2px;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

.password-toggle .icon-eye-off { display: none; }
.password-toggle.is-visible .icon-eye { display: none; }
.password-toggle.is-visible .icon-eye-off { display: block; }

.field-error {
  font-size: 13px;
  color: var(--danger);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(16, 35, 57, 0.12);
}

.auth-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px 17px 18px;
  border: 1px solid rgba(16, 35, 57, 0.1);
  border-radius: 18px;
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  font: inherit;
}

.auth-button:hover {
  transform: translateY(-1px);
  border-color: rgba(22, 52, 81, 0.22);
  box-shadow: 0 24px 40px -28px rgba(16, 35, 57, 0.32);
}

.auth-button.primary {
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  color: #f7f9fc;
  border-color: rgba(8, 22, 35, 0.22);
}

/* Sign in and Sign up, side by side and the same size.
   They were a full-width primary button and a text link in the footer,
   which reads as one action plus some small print — so a new user pressed
   Sign in with an address that has no account, and the page answered with
   a credentials error. Equal weight says these are two doors. The shade
   still ranks them: solid brand for the one most people want, the same
   hue at a fraction of its strength for the other, so they are obviously
   a pair rather than two unrelated buttons. */
.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-actions .auth-button {
  justify-content: center;
  text-decoration: none;
  text-align: center;
}

.auth-button.secondary {
  /* Enough tint to read as an action. Paler than this and the button
     looks disabled, which is the opposite of the point — it is the door
     a first-time visitor needs. */
  background: color-mix(in srgb, var(--brand) 20%, #ffffff);
  color: var(--brand-strong);
  border-color: color-mix(in srgb, var(--brand) 40%, transparent);
  font-weight: 500;
}

.auth-button.secondary:hover {
  background: color-mix(in srgb, var(--brand) 28%, #ffffff);
  border-color: color-mix(in srgb, var(--brand) 55%, transparent);
}

/* Step 2's "signing as" row: the address, and a way back to change it. */
.known-email {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(16, 35, 57, 0.12);
  border-radius: 12px;
  background: rgba(16, 35, 57, 0.03);
  font-size: 14px;
  color: var(--ink);
}

.known-email a {
  font-size: 12px;
  flex: none;
}

.auth-button.provider {
  background: rgba(255, 255, 255, 0.94);
}

.auth-button.provider:hover {
  background: #ffffff;
}

.auth-button.provider-google:hover {
  border-color: rgba(66, 133, 244, 0.28);
}

.auth-button.provider-microsoft:hover {
  border-color: rgba(0, 120, 212, 0.24);
}

.auth-main {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.auth-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(16, 35, 57, 0.06);
}

.auth-button.primary .auth-icon {
  background: rgba(255, 255, 255, 0.12);
}

.provider-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #ffffff;
  border: 1px solid rgba(16, 35, 57, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.provider-logo svg {
  width: 19px;
  height: 19px;
  display: block;
}

.auth-text {
  display: grid;
  gap: 3px;
  text-align: left;
}

.auth-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-hint {
  font-size: 12px;
  color: var(--ink-soft);
}

.auth-button.primary .auth-hint {
  color: rgba(247, 249, 252, 0.72);
}

.auth-arrow {
  font-size: 18px;
  line-height: 1;
  opacity: 0.7;
}

.messages {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.message {
  padding: 13px 15px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
}

.message--error,
.message--warning {
  border: 1px solid var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger);
}

.message--success {
  border: 1px solid var(--success-line);
  background: var(--success-bg);
  color: var(--success);
}

.message--info {
  border: 1px solid var(--info-line);
  background: var(--info-soft-bg);
  color: var(--info);
}

.message strong {
  font-weight: 700;
}

.auth-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding: 0 2px;
}

.auth-chrome-copy {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.auth-chrome-copy a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-chrome-copy a:hover {
  color: var(--brand-strong);
}

.trust-dots {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trust-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(194, 155, 102, 0.9), rgba(178, 133, 73, 0.9));
  box-shadow: 0 0 0 4px rgba(194, 155, 102, 0.12);
}

.assurance {
  display: grid;
  gap: 10px;
  margin-top: 24px;
  padding: 18px;
  border-radius: 20px;
  background: var(--info-bg);
  border: 1px solid rgba(22, 52, 81, 0.08);
}

.assurance-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
}

.assurance-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.detail-card {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(22, 52, 81, 0.08);
  background: rgba(255, 255, 255, 0.55);
}

.detail-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
}

.detail-card p {
  margin: 0;
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .panel-wrap {
    order: 1;
    padding-bottom: 14px;
  }

  .stage {
    order: 2;
    padding-top: 0;
  }

  .stage-card {
    min-height: auto;
  }
}

@media (max-width: 820px) {
  .stage,
  .panel-wrap {
    padding: 22px;
  }

  .panel {
    width: 100%;
    padding: 28px;
  }

  .stage-card {
    padding: 28px;
  }

  .headline {
    margin-top: 24px;
    max-width: 12ch;
    font-size: clamp(2.4rem, 9vw, 4rem);
  }

  .lede {
    margin-top: 16px;
    font-size: 15px;
    line-height: 1.7;
  }

  .signal-grid {
    margin-top: 24px;
  }

  .panel-title {
    font-size: 2rem;
  }
}

@media (max-width: 640px) {
  .stage,
  .panel-wrap {
    padding: 14px;
  }

  .stage-card,
  .panel {
    padding: 20px;
    border-radius: 22px;
  }

  .headline {
    margin-top: 18px;
    max-width: none;
    font-size: 2.2rem;
  }

  .brand {
    gap: 12px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 19px;
  }

  .brand-name {
    font-size: 16px;
  }

  .brand-label {
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  .lede {
    font-size: 14px;
    line-height: 1.65;
  }

  .signal-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 18px;
  }

  .panel-title,
  .panel-body h1 {
    font-size: 1.75rem;
    line-height: 1.08;
  }

  .panel-copy {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.62;
  }

  .panel-body {
    margin-top: 22px;
  }

  .auth-button {
    padding: 14px;
    border-radius: 16px;
  }

  .provider-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .provider-logo svg {
    width: 17px;
    height: 17px;
  }

  .auth-label {
    font-size: 14px;
  }

  .auth-hint {
    font-size: 11px;
    line-height: 1.45;
  }

  .auth-arrow {
    font-size: 16px;
  }

  .auth-chrome {
    margin-top: 18px;
    flex-direction: column;
    align-items: flex-start;
  }

  .stage-foot {
    margin-top: 22px;
    font-size: 12px;
    line-height: 1.55;
  }
}

@media (max-width: 480px) {
  .stage-card::after {
    width: 220px;
    height: 220px;
    inset: auto -12% -12% auto;
  }

  .stage-card {
    padding: 18px;
  }

  .panel {
    padding: 18px;
  }

  .eyebrow {
    font-size: 11px;
    letter-spacing: 0.14em;
  }

  .headline {
    font-size: 1.95rem;
  }

  .signal-grid {
    display: none;
  }

  .auth-main {
    gap: 12px;
  }

  .auth-text {
    gap: 2px;
  }

  .auth-button {
    padding: 13px;
  }

  .messages {
    margin-bottom: 14px;
  }

  .message {
    padding: 12px 13px;
    font-size: 13px;
  }
}
