/* Soul 2 Path live chat - brand colours match soul2path.com */
:root {
  --s2p-dark: #1E3F7A;
  --s2p-mid: #4169A8;
  --s2p-light: #EBF0F8;
  --s2p-ring: rgba(65, 105, 168, 0.18);
  --s2p-border: #C5D3E8;
  --s2p-radius: 12px;
  --s2p-radius-sm: 8px;

  --ink: #14223D;
  --muted: #4A5A75;
  --error: #9A3A26;
  --panel: #1E3F7A;
  --panel-deep: #142B54;
}
/* Reader pages: same brand, a deeper panel so readers can tell them apart */
.reader-app {
  --panel: #173365;
  --panel-deep: #0E1F3E;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--s2p-light);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--s2p-mid); }
a:hover { color: var(--s2p-dark); }

/* ---------- Layout: brand panel + form ---------- */

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

.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: clamp(32px, 5vw, 64px);
  color: #fff;
  background: linear-gradient(160deg, var(--panel) 0%, var(--panel-deep) 100%);
}
.auth-brand::after {
  content: "";
  position: absolute;
  right: -25%;
  bottom: -30%;
  width: 75%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .09) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}
.auth-brand > * { position: relative; z-index: 1; }

.brand-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand-logo { height: 48px; width: auto; }
.brand-tag {
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--s2p-light);
  border: 1px solid rgba(235, 240, 248, .35);
  border-radius: 999px;
}

.brand-copy { display: flex; flex-direction: column; gap: 16px; }
.auth-brand h1 {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.15;
}
.lead {
  margin: 0;
  max-width: 42ch;
  font-size: clamp(16px, 1.3vw, 18px);
  color: var(--s2p-light);
}
.points {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.points li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  color: var(--s2p-light);
}
.points svg { flex: none; margin-top: 3px; }

.brand-foot { margin: 0; font-size: 13px; color: rgba(235, 240, 248, .8); }
.brand-foot a { color: rgba(235, 240, 248, .9); }
.brand-foot a:hover { color: #fff; }

/* ---------- Form card ---------- */

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 64px);
}
.auth-card {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: clamp(24px, 4vw, 40px);
  background: #fff;
  border: 1px solid var(--s2p-border);
  border-radius: var(--s2p-radius);
  box-shadow: 0 1px 2px rgba(20, 34, 61, .04), 0 12px 32px rgba(30, 63, 122, .08);
}
.auth-card[hidden] { display: none; }
.auth-card h2 { margin: 0; font-size: clamp(22px, 2vw, 26px); line-height: 1.25; color: var(--s2p-dark); }
.card-sub { margin: 4px 0 8px; font-size: 15px; color: var(--muted); }

label, .label { margin-top: 12px; font-size: 14px; font-weight: 600; }

input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--s2p-border);
  border-radius: var(--s2p-radius-sm);
}
input:focus {
  outline: none;
  border-color: var(--s2p-mid);
  box-shadow: 0 0 0 4px var(--s2p-ring);
}

.passcode {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(6px, 1.5vw, 10px);
}
.passcode input {
  min-height: 56px;
  padding: 0;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

button {
  width: 100%;
  min-height: 50px;
  margin-top: 8px;
  padding: 0 20px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--s2p-mid);
  border: 0;
  border-radius: var(--s2p-radius-sm);
  cursor: pointer;
}
button:hover { background: var(--s2p-dark); }
button.secondary { color: var(--s2p-dark); background: #fff; border: 1px solid var(--s2p-border); }
button.secondary:hover { background: var(--s2p-light); }
button:disabled { opacity: .6; cursor: default; }
button:focus-visible, a:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--s2p-ring); }

.error { margin: 6px 0 0; min-height: 1.4em; font-size: 14px; color: var(--error); }
.hint { margin: 0; font-size: 15px; color: var(--muted); }
.switch { margin: 16px 0 0; font-size: 14px; color: var(--muted); text-align: center; }

/* ---------- Tablet and narrow windows: brand becomes a header ---------- */

@media (max-width: 960px) {
  .auth-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand {
    justify-content: flex-start;
    gap: 16px;
    padding: 24px clamp(20px, 5vw, 40px);
  }
  .auth-brand::after, .points, .brand-foot { display: none; }
  .brand-logo { height: 40px; }
  .auth-brand h1 { max-width: none; font-size: clamp(22px, 4.5vw, 30px); }
  .auth-main { align-items: flex-start; padding: 32px clamp(16px, 5vw, 40px) 48px; }
}

/* ---------- Phones ---------- */

@media (max-width: 520px) {
  .auth-brand { gap: 12px; padding: 20px 16px; }
  .brand-logo { height: 34px; }
  .lead { display: none; }
  .auth-main { padding: 12px 12px calc(32px + env(safe-area-inset-bottom, 0px)); }
  .auth-card { padding: 24px 16px; box-shadow: none; }
  .passcode input { min-height: 52px; font-size: 20px; }
}
