/* ============================================================
   Owed — sign in
   1:1 copy of Emergent's login layout (45/55 split, centred 364px
   column, inset gradient panel with a screenshot carousel). Only
   the words, the photos and the accent change.
   ============================================================ */

.auth-body {
  --au-bg: #FFFFFF;
  --au-ink: #000000;
  --au-ink-2: #666666;
  --au-muted: #767676;
  --au-placeholder: #6B7280;   /* 4.8:1; #9CA3AF was 2.5:1 */
  --au-line: #E5E7EB;
  --au-line-hover: #D1D5DB;
  --au-accent: #0071E3;
  --au-btn: #000000;
  --au-btn-hover: #1F1F1F;
  --au-btn-ink: #FFFFFF;
  --au-btn-2: #F1F1F1;
  --au-btn-2-hover: #E5E7EB;
  --au-btn-2-press: #DDDDDD;
  --au-error: #DC2626;
  --au-texture-opacity: .6;
  --au-col: 364px;
  --au-inset: 20px;

  margin: 0;
  background: var(--au-bg);
  color: var(--au-ink);
  font-family: var(--sans);
  letter-spacing: 0;
}
:root[data-theme="dark"] .auth-body {
  --au-bg: var(--paper);
  --au-ink: var(--ink);
  --au-ink-2: var(--ink-2);
  --au-muted: var(--ink-3);
  --au-placeholder: var(--ink-3);
  --au-line: var(--line);
  --au-line-hover: var(--line-2);
  --au-btn: var(--ink);
  --au-btn-hover: var(--ink-2);
  --au-btn-ink: var(--paper);
  --au-btn-2: var(--paper-3);
  --au-btn-2-hover: var(--line);
  --au-btn-2-press: var(--line-2);
  --au-texture-opacity: .18;
  --au-accent: #3B9DFF;        /* #0071E3 is 4.0:1 on the dark ground */
}

.auth-body ::selection { background: var(--au-accent); color: #FFFFFF; }
.auth-body :focus-visible { outline: 2px solid var(--au-accent); outline-offset: 2px; }

/* ---------------- canvas ---------------- */
.auth-shell {
  display: grid;
  grid-template-columns: 45% 55%;
  height: 100vh;
  min-height: 720px;
}

/* ---------------- left cell ---------------- */
.auth-left {
  position: relative;
  display: grid;
  place-items: center;
  background: var(--au-bg);
}

.auth-wordmark {
  position: absolute; z-index: 2;
  top: 12px; left: 12px;
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 12px;
  font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em;
  color: var(--au-ink); text-decoration: none;
  border-radius: 8px;
  transition: opacity .15s var(--ease);
}
.auth-wordmark:hover { opacity: .7; }
.auth-lang { position: absolute; z-index: 2; top: 12px; right: 12px; }

/* faint character grid in the two left corners — a data-URI tile,
   so it needs no image request */
.auth-texture {
  position: absolute; z-index: 0; left: 0;
  pointer-events: none;
  opacity: var(--au-texture-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='72'%3E%3Cg font-family='ui-monospace,Menlo,Consolas,monospace' font-size='11' fill='%23E3E3E3'%3E%3Ctext x='6' y='16'%3E0%3C/text%3E%3Ctext x='30' y='16'%3Ea%3C/text%3E%3Ctext x='54' y='16'%3E7%3C/text%3E%3Ctext x='78' y='16'%3Em%3C/text%3E%3Ctext x='6' y='40'%3Ex%3C/text%3E%3Ctext x='30' y='40'%3E3%3C/text%3E%3Ctext x='54' y='40'%3Ek%3C/text%3E%3Ctext x='78' y='40'%3E1%3C/text%3E%3Ctext x='6' y='64'%3E9%3C/text%3E%3Ctext x='30' y='64'%3Ee%3C/text%3E%3Ctext x='54' y='64'%3E5%3C/text%3E%3Ctext x='78' y='64'%3Ez%3C/text%3E%3C/g%3E%3C/svg%3E");
  background-size: 96px 72px;
}
.auth-texture-top {
  top: 0; width: 320px; height: 240px;
  -webkit-mask-image: radial-gradient(ellipse at top left, #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse at top left, #000 0%, transparent 70%);
}
.auth-texture-bottom {
  bottom: 0; width: 480px; height: 360px;
  -webkit-mask-image: radial-gradient(ellipse at bottom left, #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse at bottom left, #000 0%, transparent 70%);
}

/* the centred column */
.auth-col {
  position: relative; z-index: 1;
  width: var(--au-col); max-width: 100%;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.auth-mark { flex: none; width: auto; height: 60px; margin-bottom: 24px; }

.auth-title {
  font-size: 32px; line-height: 36px; font-weight: 600; letter-spacing: -.01em;
  color: var(--au-ink);
  text-wrap: initial;
  white-space: nowrap;       /* the reference heading is wider than the field */
  width: max-content; max-width: calc(100vw - 48px);
  padding-bottom: 2px;
}
.auth-title-accent { color: var(--au-accent); }

.auth-sub {
  margin-top: 22px;
  font-size: 16px; line-height: 24px;
  color: var(--au-ink-2);
}
.auth-sub strong { font-weight: 600; color: var(--au-ink); }

.auth-form {
  width: 100%;
  margin-top: 28px;
  display: flex; flex-direction: column; align-items: stretch;
}

/* the one pill field */
.auth-field {
  position: relative;
  width: 100%; height: 47px;
  color: var(--au-ink-2);
}
.auth-field-icon {
  position: absolute; top: 50%; left: 18px;
  transform: translateY(-50%);
  pointer-events: none;
  color: #6B7280;
}
.auth-field-icon-right { left: auto; right: 16px; color: var(--au-placeholder); }
.auth-input {
  width: 100%; height: 47px;
  padding: 0 44px 0 42px;
  border: 1px solid var(--au-line);
  border-radius: 9999px;
  background: var(--au-bg);
  color: var(--au-ink);
  font-size: 16px; line-height: 24px;
  caret-color: var(--au-ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.auth-input::placeholder { color: var(--au-placeholder); opacity: 1; }
.auth-input:hover { border-color: var(--au-line-hover); }
.auth-input:focus { outline: none; border-color: var(--au-accent); box-shadow: 0 0 0 1px var(--au-accent); }
.auth-input:not(:placeholder-shown) ~ .auth-field-icon-right { color: #6B7280; }
.auth-field.is-error .auth-input { border-color: var(--au-error); box-shadow: 0 0 0 1px var(--au-error); }
.auth-field.is-error.is-shaking { animation: auth-shake .2s var(--ease) 2; }
@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* the 'Forgot password?' slot: always 24px tall so nothing shifts */
.auth-help {
  margin-top: 16px;
  min-height: 24px;
  font-size: 16px; line-height: 24px;
  color: var(--au-ink-2);
  text-align: center;
}
.auth-help.is-error { color: var(--au-error); }

/* the two pills */
.auth-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 49px;
  border: 0; border-radius: 9999px;
  font-size: 17px; font-weight: 500; line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s var(--ease), transform .1s var(--ease);
}
.auth-btn:focus-visible { outline: 2px solid var(--au-accent); outline-offset: 3px; }
.auth-btn:active { transform: translateY(1px); }
.auth-btn-primary { margin-top: 24px; background: var(--au-btn); color: var(--au-btn-ink); }
.auth-btn-primary:hover { background: var(--au-btn-hover); }
.auth-btn-secondary { margin-top: 18px; background: var(--au-btn-2); color: var(--au-ink); }
.auth-btn-secondary:hover { background: var(--au-btn-2-hover); }
.auth-btn-secondary:active { background: var(--au-btn-2-press); }

.auth-fine {
  margin-top: 22px;
  font-size: 16px; line-height: 22px;
  color: var(--au-ink-2);
}
.auth-fine a {
  display: inline-block; padding: 11px 0; margin: -11px 0;   /* 44px hit area, no layout shift */
  color: var(--au-ink);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px;
}
.auth-fine a:hover { color: var(--au-accent); }

/* ---------------- right cell ---------------- */
.auth-right { padding: var(--au-inset); min-width: 0; }

.auth-panel {
  position: relative;
  width: 100%; height: 100%;
  min-height: 680px;
  border-radius: 26px;
  overflow: hidden;
  /* 152px at 900 tall, shrinking on short screens so the pager stays inside */
  padding: clamp(64px, calc(100vh - 748px), 152px) 20px 0;
  display: flex; flex-direction: column; align-items: center;
  color: #FFFFFF;
  background: #4F8FF7;
}

.auth-badge {
  position: absolute; top: 20px; right: 20px;
  display: inline-flex; align-items: center; gap: 8px;
  height: 26px; padding: 0 12px 0 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .28);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-size: 14px; font-weight: 500; line-height: 26px;
  color: #111111; white-space: nowrap;   /* white on the frosted blue was 2.3:1 */
}

.auth-panel-head { text-align: center; max-width: 544px; }
.auth-panel-title { font-size: 28px; line-height: 34px; font-weight: 600; color: #FFFFFF; letter-spacing: -.01em; }
.auth-panel-sub { margin-top: 12px; font-size: 16px; line-height: 24px; color: #FFFFFF; }

/* the screenshot slot: a photo card with a browser chrome bar */
.auth-carousel {
  width: 100%;
  margin-top: 56px;
  display: flex; flex-direction: column; align-items: center;
}
.auth-shot {
  width: min(581px, 100%);
  aspect-ratio: 581 / 368;
  border-radius: 15px;
  overflow: hidden;
  background: #1F1F1F;
  box-shadow: 0 24px 48px rgba(0, 0, 0, .25);
  display: flex; flex-direction: column;
}
.auth-chrome {
  flex: none;
  position: relative;
  height: 22px;
  background: #1F1F1F;
  display: flex; align-items: center;
}
.auth-chrome-dots {
  position: absolute; left: 12px; top: 0; bottom: 0;
  display: flex; align-items: center; gap: 6px;
}
.auth-chrome-dots i { width: 8px; height: 8px; border-radius: 50%; background: #FF5F57; }
.auth-chrome-dots i:nth-child(2) { background: #FEBC2E; }
.auth-chrome-dots i:nth-child(3) { background: #28C840; }
.auth-caption {
  margin: 0 auto;
  max-width: calc(100% - 96px);
  padding: 0 12px;
  border-radius: 6px;
  background: #2A2A2A;
  font-size: 14px; font-weight: 500; line-height: 22px;
  color: rgba(255, 255, 255, .85);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.auth-slides { position: relative; flex: 1 1 auto; min-height: 0; }
.auth-slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.auth-slide.is-on { opacity: 1; }

/* pager */
.auth-pager {
  margin-top: 80px;
  display: flex; align-items: center; gap: 26px;
}
.auth-pager-arrow {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #FFFFFF;
}
.auth-pager-arrow span {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, .4);   /* the panel is light aqua here: white-on-white failed 3:1 */
  transition: background-color .15s var(--ease);
}
.auth-pager-arrow:hover span { background: rgba(0, 0, 0, .55); }
.auth-dots { display: flex; align-items: center; gap: 0; }
.auth-dot {
  min-width: 24px; height: 44px; padding: 0 8px;
  display: grid; place-items: center;
  border-radius: 9999px;
}
.auth-dot span {
  display: block;
  width: 7px; height: 7px; border-radius: 9999px;
  background: rgba(0, 0, 0, .45);
  transition: width .2s var(--ease), background-color .15s var(--ease);
}
.auth-dot:hover span { background: rgba(0, 0, 0, .65); }
.auth-dot.is-on span { width: 34px; background: #111111; }
.auth-pager-arrow:focus-visible, .auth-dot:focus-visible { outline: 2px solid #111111; outline-offset: 0; }

/* ---------------- responsive ---------------- */
@media (max-width: 1180px) {
  .auth-shell { grid-template-columns: 50% 50%; }
  .auth-shot { width: min(581px, 100% - 40px); }
}

@media (max-width: 819px) {
  .auth-body { --au-inset: 12px; }
  .auth-shell {
    grid-template-columns: 100%;
    height: auto; min-height: 0;
  }
  .auth-left {
    min-height: 100vh; min-height: 100svh;
    padding: 88px 24px 40px;
  }
  .auth-texture-bottom { width: 320px; height: 200px; }
  .auth-caption { margin-left: 48px; margin-right: 12px; max-width: calc(100% - 60px); }
  .auth-col { width: min(var(--au-col), 100%); }
  .auth-title { font-size: 28px; line-height: 34px; white-space: normal; width: auto; max-width: 100%; }
  .auth-right { padding: 0 var(--au-inset) var(--au-inset); }
  .auth-panel {
    height: auto; min-height: 0;
    padding: 72px 16px 40px;
  }
  .auth-badge { top: 12px; right: 12px; }
  .auth-carousel { margin-top: 32px; }
  .auth-shot { width: 100%; }
  .auth-pager { margin-top: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-slide, .auth-dot span, .auth-btn, .auth-input { transition: none; }
  .auth-field.is-error.is-shaking { animation: none; }
}

/* ---------- the panel's centrepiece: eight icon tiles on a slow 3D ring ---------- */
.auth-ring-wrap { position: relative; height: 380px; margin-top: 36px; perspective: 1100px; display: flex; align-items: center; justify-content: center; }
.auth-ring { position: relative; width: 132px; height: 132px; transform-style: preserve-3d; animation: ring-spin 26s linear infinite; }
.auth-ring.is-paused { animation-play-state: paused; }
.auth-tile { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 30px; background: rgba(255, 255, 255, .94); color: #000; box-shadow: 0 24px 48px rgba(0, 0, 0, .22); backface-visibility: hidden; }
.auth-tile svg { width: 60px; height: 60px; }
.auth-tile:nth-child(1) { transform: rotateY(0deg) translateZ(270px); }
.auth-tile:nth-child(2) { transform: rotateY(45deg) translateZ(270px); }
.auth-tile:nth-child(3) { transform: rotateY(90deg) translateZ(270px); }
.auth-tile:nth-child(4) { transform: rotateY(135deg) translateZ(270px); }
.auth-tile:nth-child(5) { transform: rotateY(180deg) translateZ(270px); }
.auth-tile:nth-child(6) { transform: rotateY(225deg) translateZ(270px); }
.auth-tile:nth-child(7) { transform: rotateY(270deg) translateZ(270px); }
.auth-tile:nth-child(8) { transform: rotateY(315deg) translateZ(270px); }
@keyframes ring-spin { from { transform: rotateX(-10deg) rotateY(0deg); } to { transform: rotateX(-10deg) rotateY(360deg); } }
.auth-ring-pause { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .28); color: #FFF; cursor: pointer; display: grid; place-items: center; }
.auth-ring-pause:hover { background: rgba(255, 255, 255, .4); }
.auth-mark { border-radius: 16px; }
@media (max-width: 820px) { .auth-ring-wrap { height: 300px; } .auth-ring { width: 104px; height: 104px; } .auth-tile:nth-child(n) { --z: 190px; } .auth-tile svg { width: 48px; height: 48px; } }
@media (prefers-reduced-motion: reduce) { .auth-ring { animation: none; transform: rotateX(-10deg) rotateY(20deg); } }

/* Emergent's panel, measured: blue top, a white-cyan bloom in the middle, teal at the foot */
.auth-panel::before, .auth-panel::after { display: none !important; }
/* every tile shows an icon from both sides, so the ring reads all the way round */
.auth-tile { backface-visibility: visible; }
.auth-face { position: absolute; inset: 0; display: grid; place-items: center; backface-visibility: hidden; border-radius: inherit; }
.auth-face-back { transform: rotateY(180deg); }
.auth-field + .auth-field { margin-top: 12px; }

/* Emergent's panel is a looping cloud film under glass, not a gradient: Owed's own
   sea footage plays here, tinted to the same blue-to-teal palette */
.auth-panel { position: relative; overflow: hidden; background: #1F4DA8 !important; }
.auth-panel-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.auth-panel-tint { position: absolute; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(180deg, rgba(31, 77, 168, .32) 0%, rgba(0, 113, 227, .08) 45%, rgba(20, 130, 128, .3) 100%); }
.auth-panel > *:not(.auth-panel-video):not(.auth-panel-tint) { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .auth-panel-video { display: none; } .auth-panel { background: #1F4DA8 url("../img/panel-poster.webp") center / cover no-repeat !important; } }

.auth-badge { position: absolute !important; z-index: 2; }

/* ================= phone pass (audit) ================= */
@media (max-width: 819px) {
  .auth-panel { min-height: 380px; justify-content: center; padding: 40px 16px; }
  .auth-panel-video { object-position: 64% 50%; }
  .auth-left { min-height: 0; padding: 88px 24px 56px; }
  .auth-right { padding-top: 8px; }
  .auth-help { min-height: 48px; text-wrap: balance; }
  .auth-field-icon-right { display: none; }
  .auth-input { padding-right: 20px; }
}
/* the label can be long ("Continue as ...") — one line, ellipsised, never spilling the pill */
.auth-btn { height: auto; min-height: 49px; padding: 0 20px; }
.auth-btn > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* white type over a drifting film needs a real scrim */
.auth-panel-tint { background: linear-gradient(180deg, rgba(9, 28, 66, .62) 0%, rgba(9, 38, 86, .46) 45%, rgba(10, 54, 64, .52) 100%) !important; }
.auth-panel-head { text-shadow: 0 1px 14px rgba(0, 0, 0, .45); }
.auth-panel-sub { text-wrap: balance; max-width: 30ch; margin-left: auto; margin-right: auto; }
