/* PI Flow auth — left login panel (reference-faithful) + right visual slot */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

body.pi-flow-auth {
  --pi-bg: #111214;
  --pi-signal: #e60023;
  --pi-signal-hover: #cc001f;
  --pi-signal-pressed: #b3001b;
  --pi-text: #ffffff;
  --pi-text-secondary: #9ca3af;
  --pi-elevated: #1c1d21;
  --pi-border: #3f4248;
  --pi-radius: 4px;
  --pi-form-max: 310px;
  margin: 0;
  background: var(--pi-bg) !important;
  color: var(--pi-text);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

body.pi-flow-auth,
body.pi-flow-auth button,
body.pi-flow-auth input,
body.pi-flow-auth label,
body.pi-flow-auth a {
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif !important;
}

body.pi-flow-auth #app {
  min-height: 100dvh;
}

/* Desktop: left ~42% form / right ~58% visual */
body.pi-flow-auth main.pi-flow-main {
  display: grid !important;
  grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
  grid-template-rows: minmax(0, 1fr);
  width: 100% !important;
  max-width: none !important;
  min-height: 100dvh !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: var(--pi-bg) !important;
}

/* Left form column — vertically & horizontally centered */
body.pi-flow-auth .pi-flow-shell__form {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 40px 24px;
  background: var(--pi-bg);
  box-sizing: border-box;
}

body.pi-flow-auth .pi-flow-shell__form-inner {
  width: 100%;
  max-width: var(--pi-form-max);
}

body.pi-flow-auth .pi-flow-shell__form main,
body.pi-flow-auth .pi-flow-shell__form > section,
body.pi-flow-auth main.pi-flow-main > .pi-flow-shell__form section {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* When sections stay as direct children (fallback layout) */
body.pi-flow-auth main.pi-flow-main > section:not(.pi-flow-shell__visual) {
  grid-column: 1;
  width: 100% !important;
  max-width: var(--pi-form-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  box-sizing: border-box !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

body.pi-flow-auth .pi-flow-shell__form section:first-of-type,
body.pi-flow-auth main.pi-flow-main > section:first-of-type {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left !important;
  margin-bottom: 28px !important;
}

/* One logo only */
body.pi-flow-auth .pi-flow-shell__form section:first-of-type img,
body.pi-flow-auth main.pi-flow-main section:first-of-type img {
  height: 36px !important;
  width: auto !important;
  margin: 0 0 28px !important;
}

body.pi-flow-auth .pi-flow-shell__form section:first-of-type img:first-of-type,
body.pi-flow-auth main.pi-flow-main section:first-of-type img:first-of-type {
  display: block !important;
}

body.pi-flow-auth .pi-flow-shell__form section:first-of-type img:not(:first-of-type),
body.pi-flow-auth main.pi-flow-main section:first-of-type img:not(:first-of-type) {
  display: none !important;
}

body.pi-flow-auth .pi-flow-shell__form section:first-of-type h2,
body.pi-flow-auth main.pi-flow-main section:first-of-type h2,
body.pi-flow-auth .pi-flow-heading {
  margin: 0 0 10px !important;
  color: #ffffff !important;
  font-size: 28px !important;
  font-weight: 600 !important;
  letter-spacing: -0.03em !important;
  line-height: 1.15 !important;
  text-align: left !important;
}

body.pi-flow-auth .pi-flow-subheading {
  margin: 0;
  max-width: 34ch;
  color: var(--pi-text-secondary);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
}

/* Form card: strip Chatwoot white card chrome */
body.pi-flow-auth .pi-flow-shell__form section:not(:first-of-type),
body.pi-flow-auth main.pi-flow-main > section:not(:first-of-type):not(.pi-flow-shell__visual) {
  margin-top: 0 !important;
}

body.pi-flow-auth label,
body.pi-flow-auth .text-n-slate-12 {
  color: var(--pi-text) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

body.pi-flow-auth .text-n-slate-11,
body.pi-flow-auth .text-sm {
  color: var(--pi-text-secondary) !important;
}

body.pi-flow-auth a.text-link,
body.pi-flow-auth a[class*='text-link'] {
  color: var(--pi-text-secondary) !important;
  text-decoration: none !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

body.pi-flow-auth a.text-link:hover,
body.pi-flow-auth a[class*='text-link']:hover {
  color: var(--pi-text) !important;
}

body.pi-flow-auth form {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

body.pi-flow-auth input[type='text'],
body.pi-flow-auth input[type='email'],
body.pi-flow-auth input[type='password'],
body.pi-flow-auth input:not([type]) {
  height: 44px !important;
  border-radius: var(--pi-radius) !important;
  border: 1px solid var(--pi-border) !important;
  background: var(--pi-elevated) !important;
  color: var(--pi-text) !important;
  box-shadow: none !important;
  font-size: 14px !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}

body.pi-flow-auth input::placeholder {
  color: var(--pi-text-secondary) !important;
  opacity: 1 !important;
}

body.pi-flow-auth input:hover:not(:disabled):not(:focus):not(:focus-visible) {
  border-color: #5a5e66 !important;
}

body.pi-flow-auth input:focus,
body.pi-flow-auth input:focus-visible {
  border-color: var(--pi-signal) !important;
  outline: 1px solid var(--pi-signal) !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
}

body.pi-flow-auth input:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
}

body.pi-flow-auth button[type='submit'],
body.pi-flow-auth button[data-testid='submit_button'] {
  width: 100% !important;
  height: 44px !important;
  margin-top: 4px !important;
  border-radius: var(--pi-radius) !important;
  border: 1px solid var(--pi-signal) !important;
  background: var(--pi-signal) !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
  box-shadow: none !important;
}

body.pi-flow-auth button[type='submit']:hover:not(:disabled),
body.pi-flow-auth button[data-testid='submit_button']:hover:not(:disabled) {
  background: var(--pi-signal-hover) !important;
  border-color: var(--pi-signal-hover) !important;
}

body.pi-flow-auth button[type='submit']:active:not(:disabled),
body.pi-flow-auth button[data-testid='submit_button']:active:not(:disabled) {
  background: var(--pi-signal-pressed) !important;
  border-color: var(--pi-signal-pressed) !important;
}

body.pi-flow-auth button[type='submit']:focus-visible,
body.pi-flow-auth button[data-testid='submit_button']:focus-visible {
  outline: 2px solid #ffffff !important;
  outline-offset: 2px !important;
}

body.pi-flow-auth button[type='submit']:disabled,
body.pi-flow-auth button[data-testid='submit_button']:disabled,
body.pi-flow-auth button[type='submit'][aria-busy='true'],
body.pi-flow-auth button[data-testid='submit_button'][aria-busy='true'] {
  opacity: 0.7 !important;
  cursor: progress !important;
}

/* Right visual slot — static image, no decorative gradients */
body.pi-flow-auth main.pi-flow-main > .pi-flow-shell__visual {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  margin: 0 !important;
  padding: 0 !important;
  background: #101014;
  border-left: none;
  box-shadow: none !important;
}

/* Prefer the provided still; keep canvas off for this panel look */
body.pi-flow-auth .pi-flow-shell__visual canvas {
  display: none !important;
}

body.pi-flow-auth .pi-flow-shell__fallback {
  position: absolute;
  inset: 0;
  background: url(/brand-assets/pi-flow/piflow.webp) top / cover no-repeat, #101014;
  filter: grayscale(0.15) contrast(1.05);
  opacity: 0.9;
}

@media (max-width: 960px) {
  body.pi-flow-auth main.pi-flow-main {
    display: block !important;
    height: auto !important;
    min-height: 100dvh !important;
    overflow: auto !important;
  }

  body.pi-flow-auth .pi-flow-shell__form {
    min-height: 100dvh;
    padding: 32px 20px;
  }

  body.pi-flow-auth main.pi-flow-main > .pi-flow-shell__visual {
    display: none !important;
  }

  body.pi-flow-auth .pi-flow-shell__form-inner,
  body.pi-flow-auth main.pi-flow-main > section:not(.pi-flow-shell__visual) {
    max-width: var(--pi-form-max) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.pi-flow-auth .pi-flow-shell__fallback {
    filter: none;
    opacity: 1;
  }
}
