/* ============================================================
   Login page — Split coordination story
   All rules scoped to body.login-page.
   ============================================================ */

body.login-page [hidden] {
  display: none !important;
}

body.login-page {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
}

/* box-sizing + .pp-link / .pp-link-strong moved to styles.css (global):
   the link classes are also used by React islands on /app pages, where this
   stylesheet never loads. */

/* ── Layout ─────────────────────────────────────────────── */

.login-split {
  display: flex;
  min-height: var(--viewport-height-under-banner);
  width: 100%;
}

/* ── Brand panel (left) ─────────────────────────────────── */

.brand-panel {
  flex: 1.18;
  min-width: 0;
  position: relative;
  overflow: hidden;
  color: var(--brand-panel-fg);
  background: linear-gradient(
    155deg,
    var(--brand-panel-bg-1) 0%,
    var(--brand-panel-bg-2) 50%,
    var(--brand-panel-bg-3) 100%
  );
  padding: 44px 60px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.brand-blob-top {
  top: -120px;
  right: -160px;
  width: 460px;
  height: 460px;
  background: radial-gradient(
    circle at center,
    var(--brand-panel-blob-glow) 0%,
    transparent 60%
  );
  opacity: 0.32;
}
.brand-blob-bottom {
  bottom: -160px;
  left: -120px;
  width: 380px;
  height: 380px;
  background: radial-gradient(
    circle at center,
    var(--color-claimed) 0%,
    transparent 65%
  );
  opacity: 0.22;
}

.brand-header {
  position: relative;
  z-index: 2;
}
.brand-body {
  position: relative;
  z-index: 2;
  max-width: 540px;
}
.brand-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12px;
  opacity: 0.55;
}

.pp-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* The panel looks the same in both themes, so its logo must too. */
body.login-page .pp-logo .pp-brand-mark {
  --brand-mark-ring: var(--group-color-1);
  --brand-mark-node: var(--group-color-1);
  --brand-mark-glyph: var(--brand-panel-fg);
}
.pp-logo-word {
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.brand-headline {
  margin: 0 0 18px;
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.brand-subhead {
  margin: 0 0 36px;
  max-width: 440px;
  font-size: 16px;
  line-height: 1.55;
  opacity: 0.78;
}

/* ── Household preview ──────────────────────────────────── */

.household-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 380px;
  max-width: 100%;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(12px);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5);
}

.household-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.household-preview-date {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.household-preview-avatars {
  display: inline-flex;
  gap: 4px;
}

.avatar-chip {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--brand-panel-fg);
  box-shadow: 0 0 0 2px var(--brand-panel-ring);
}
.avatar-chip + .avatar-chip {
  margin-left: -6px;
}
.avatar-chip[data-color="indigo"] {
  background: var(--color-primary-container);
}
.avatar-chip[data-color="slate"] {
  background: var(--status-theirs);
}
.avatar-chip[data-color="green"] {
  background: var(--color-claimed);
}

.household-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.event-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.event-icon-mine {
  background: color-mix(in oklab, var(--color-claimed) 18%, transparent);
  color: var(--brand-panel-text-mine);
}
.event-icon-theirs {
  background: color-mix(in oklab, var(--status-theirs) 22%, transparent);
  color: var(--brand-panel-text-theirs);
}
.event-icon-open {
  background: color-mix(in oklab, var(--status-open) 16%, transparent);
  color: var(--brand-panel-text-open);
}

.event-body {
  flex: 1;
  min-width: 0;
}
.event-what {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-panel-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-when {
  margin-top: 1px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

.event-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 7px;
  border-radius: 9999px;
}
.event-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.event-badge-mine {
  background: color-mix(in oklab, var(--color-claimed) 18%, transparent);
  color: var(--brand-panel-text-mine);
}
.event-badge-theirs {
  background: color-mix(in oklab, var(--status-theirs) 22%, transparent);
  color: var(--brand-panel-text-theirs);
}
.event-badge-open {
  background: color-mix(in oklab, var(--status-open) 16%, transparent);
  color: var(--brand-panel-text-open);
}

.household-preview-cta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--color-claimed) 18%, transparent);
  border: 1px solid color-mix(in oklab, var(--color-claimed) 32%, transparent);
}
.household-preview-cta-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-panel-cta-text);
}
.household-preview-cta-button {
  background: var(--color-claimed);
  color: var(--brand-panel-fg);
  border: none;
  padding: 5px 10px;
  border-radius: 9999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
}
.household-preview-cta-button:hover {
  filter: brightness(0.96);
}

/* ── Form panel (right) ─────────────────────────────────── */

.form-panel {
  width: 480px;
  flex-shrink: 0;
  background: var(--color-card);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 60px;
  border-left: 1px solid var(--color-border-subtle);
}

.form-stack {
  display: flex;
  flex-direction: column;
}

.form-header {
  margin-bottom: 28px;
}
.form-title {
  margin: 0;
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: 28px;
  color: var(--color-text-primary);
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.form-subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.login-error {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-error-container);
  color: var(--color-on-error-container);
  font-size: 13px;
  font-weight: 500;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.field input {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text-primary);
  background: var(--color-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: 9px;
  outline: none;
}

.field-failed input {
  border-color: var(--color-error);
}
.field-error {
  display: flex;
  gap: 4px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-error);
}
.field-error[hidden] {
  display: none;
}

.primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  transition: filter 120ms, transform 120ms;
}
.primary-btn:hover:not([disabled]) {
  filter: brightness(0.96);
}
.primary-btn:active:not([disabled]) {
  transform: translateY(0.5px);
}
.primary-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
}

.secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--color-card);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
}
.secondary-btn:hover:not([disabled]) {
  background: var(--color-surface-container-low);
}
.secondary-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
}

.text-btn {
  align-self: center;
  padding: 6px 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
}
.text-btn:hover:not([disabled]) {
  text-decoration: underline;
}
.text-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
}

.magic-link-sent {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}
.code-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.magic-link-sent-icon {
  align-self: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-container);
  color: var(--color-primary);
  margin-bottom: 6px;
}

.form-footer {
  margin: 24px 0 0;
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: center;
}

/* ── Magic-link landing (/auth/verify) ──────────────────── */

.auth-verify {
  min-height: var(--viewport-height-under-banner);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 36px 32px;
  border-radius: 18px;
  background: var(--color-card);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-card);
  text-align: center;
}
.auth-card .form-title {
  margin-top: 6px;
}
.auth-card .form-subtitle {
  margin: 0;
}
.auth-card .login-error {
  width: 100%;
  margin-top: 6px;
}
.auth-card .primary-btn {
  margin-top: 10px;
  text-decoration: none;
}

/* ── Responsive: stack below 900px ──────────────────────── */

@media (max-width: 900px) {
  .login-split {
    flex-direction: column;
  }

  .brand-panel {
    padding: 32px 28px 32px;
    flex: 0 0 auto;
  }
  .brand-headline {
    font-size: 34px;
  }
  .brand-subhead {
    margin-bottom: 24px;
  }
  .household-preview {
    display: none;
  }
  .brand-footer {
    margin-top: 24px;
  }

  .form-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--color-border-subtle);
    padding: 32px 24px 48px;
  }
}

@media (max-width: 480px) {
  .brand-panel {
    padding: 24px 20px;
  }
  .brand-headline {
    font-size: 28px;
  }
  .brand-subhead {
    font-size: 14px;
  }
  .form-panel {
    padding: 24px 20px 40px;
  }
  .form-title {
    font-size: 24px;
  }
}
