/* Page: Sign in ---------------------------------------------------------------
   Split layout: brand panel (left) + sign-in panel (right).
   Stacks on small screens with the brand panel as a short header.
   ------------------------------------------------------------------------- */

.pw-auth-shell { min-height: 100vh; }

.pw-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}

/* ---- Brand panel -------------------------------------------------------- */
.pw-auth__brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-8);
  padding: var(--space-10) clamp(32px, 5vw, 72px);
  background: var(--hero-bg);
  color: var(--hero-ink);
}
.pw-auth__brand > * { position: relative; z-index: 1; }

.pw-auth__logo { height: 64px; width: auto; }

.pw-auth__pitch { display: flex; flex-direction: column; gap: var(--space-6); max-width: 540px; }

.pw-auth__study {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--hero-line);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm); font-weight: 600;
  color: var(--hero-ink);
}
.pw-auth__study-logo {
  width: 28px; height: 28px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 0 0 1.5px var(--hero-line);
  font-size: 10px; font-weight: 700;
}

.pw-auth__headline {
  font-size: clamp(32px, 3.2vw, 46px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hero-ink);
  text-wrap: balance;
}
.pw-auth__headline em { display: block; font-style: normal; color: var(--pw-mint); }

.pw-auth__points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.pw-auth__points li { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-lg); color: var(--hero-soft); }
.pw-auth__points .icon {
  width: 32px; height: 32px; padding: 7px;
  border-radius: var(--radius-md);
  background: var(--hero-tint);
  color: var(--pw-mint);
}

.pw-auth__brand-foot { font-size: var(--text-sm); color: var(--hero-soft); }

/* Tertiary PeopleWith icon as a watermark, right-hand side (brand guidelines) */
.pw-auth__art {
  position: absolute; z-index: 0;
  width: 540px; max-width: none; height: auto;
  right: -150px; bottom: -8px;
  opacity: .16;
  pointer-events: none;
}

/* ---- Sign-in panel ------------------------------------------------------ */
.pw-auth__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-6) var(--space-8) var(--space-6);
  background: var(--bg);
}
.pw-auth__panel-top { align-self: stretch; display: flex; justify-content: flex-end; }

.pw-auth__card {
  flex-grow: 1;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-6);
  padding: var(--space-8) 0;
}

.pw-auth__view { display: flex; flex-direction: column; gap: var(--space-6); }
.pw-auth__heading { display: flex; flex-direction: column; gap: var(--space-2); }
.pw-auth__heading h1 { font-size: var(--text-3xl); }
.pw-auth__heading p { font-size: var(--text-base); }
.pw-auth__heading .pw-back { margin-bottom: var(--space-2); }

.pw-auth__alert { padding: var(--space-3) var(--space-4); gap: var(--space-3); align-items: flex-start; }
.pw-auth__alert > .icon { margin-top: 1px; }

.pw-auth__form { display: flex; flex-direction: column; gap: var(--space-5); }
.pw-auth__form .pw-input { background: var(--surface); height: 48px; font-size: var(--text-lg); }
.pw-auth__form .pw-input[aria-invalid="true"] { border-color: var(--crit); }

.pw-auth__label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }

/* Password with show/hide */
.pw-password { position: relative; display: block; }
.pw-password .pw-input { padding-right: 72px; }
.pw-password__toggle {
  position: absolute; top: 6px; right: 6px;
  height: 36px; padding: 0 12px;
  border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink-2);
  font: 600 var(--text-sm)/1 var(--font-body);
}
.pw-password__toggle:hover { background: var(--surface-2); color: var(--ink); }

.pw-auth__caps { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--warn); }

.pw-auth__submit { height: 48px; font-size: var(--text-base); margin-top: var(--space-1); }
.pw-auth__submit.is-loading { opacity: .8; cursor: progress; }
.pw-auth__submit.is-loading .js-submit-label::before,
.pw-auth .is-loading .js-reset-label::before {
  content: '';
  display: inline-block; vertical-align: -3px; margin-right: 10px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: pw-spin .8s linear infinite;
}
@keyframes pw-spin { to { transform: rotate(360deg); } }

.pw-auth__help { font-size: var(--text-sm); color: var(--ink-3); padding-top: var(--space-5); border-top: 1px solid var(--line); }

/* Mock-mode demo accounts */
.pw-auth__demo { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border: 1px dashed var(--line-2); border-radius: var(--radius-lg); }
.pw-auth__demo-btn {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  min-height: 40px; padding: 0 var(--space-3);
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); color: var(--ink); font-size: var(--text-sm); text-align: left;
}
.pw-auth__demo-btn:hover { border-color: var(--brand); }
.pw-auth__demo-btn .u-mono { font-size: var(--text-xs); color: var(--ink-3); }

.pw-auth__legal { font-size: var(--text-xs); text-align: center; }

/* ---- Small screens ------------------------------------------------------ */
@media (max-width: 900px) {
  .pw-auth { grid-template-columns: minmax(0, 1fr); }
  .pw-auth__brand { padding: var(--space-6) var(--space-5); gap: var(--space-4); }
  .pw-auth__points, .pw-auth__brand-foot { display: none; }
  .pw-auth__headline { font-size: 28px; }
  .pw-auth__art { display: none; }
  .pw-auth__logo { height: 44px; }
  .pw-auth__panel { padding: var(--space-4) var(--space-4) var(--space-6); }
  .pw-auth__card { padding: var(--space-4) 0; justify-content: flex-start; }
}

/* Debug detail under an error (FORCE_DEBUG / DEBUGACCESS only) */
.pw-auth .pw-alert__code { display: block; margin-top: 6px; padding: 6px 8px; border-radius: 6px; background: var(--surface-2); font-family: var(--font-mono); font-size: var(--text-xs); word-break: break-word; }
