:root {
  color-scheme: light;
  --primary: #2563eb;
  --navy: #0f172a;
  --teal: #14b8a6;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary-soft: #1d4ed8;
}

* {
  box-sizing: border-box;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  margin: 0;
  background: linear-gradient(120deg, #e0e7ff 0%, #f8fafc 60%, #e2f8f2 100%);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.auth-shell {
  /* Plain flexbox, not CSS Grid: grid's 1fr/minmax track-sizing algorithm
     recalculates column tracks as a byproduct of *any* content change
     inside them, and several rounds of pinning the media panel's own size
     (height, then contain: layout size) didn't stop the sign-in form next
     to it from visibly moving - which points at the shared row/track
     itself being the thing recalculating, not the media panel's own box.
     Flexbox's box model is simpler to reason about explicitly: each panel
     below gets its own fixed flex-basis and align-self: flex-start, so
     there is no shared track and no cross-item size dependency at all. */
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  padding: 32px 20px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.auth-panel {
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 40px 80px rgba(15, 23, 42, 0.12);
  /* Fixed basis, won't grow, can shrink down to min-width on narrower
     screens (the media panel is hidden below 980px anyway - see the media
     query at the bottom of this file). align-self: flex-start (repeated
     here, not just inherited from .auth-shell's align-items) makes each
     panel's own height purely a function of its own content, full stop. */
  flex: 0 1 500px;
  min-width: 320px;
  max-width: 100%;
  align-self: flex-start;
  box-sizing: border-box;
  /* Matches the media panel's fixed 576px height (.auth-media-panel) as a
     floor, not a hard height - the sign-in card visually lines up with the
     image card in the common case (this is a min-height, not height, so a
     form with more fields than fit in 576px - e.g. signup - still grows
     instead of clipping). */
  min-height: 576px;
}

.auth-form-panel {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.brand img {
  width: 54px;
  height: 54px;
}

.brand-name {
  font-family: 'Barlow Condensed', 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #0a0f2c;
}

.auth-head h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.auth-head p {
  margin: 0;
  color: var(--muted);
}


.auth-message {
  min-height: 20px;
  font-size: 13px;
  color: var(--muted);
}

.auth-message.error {
  color: #dc2626;
}

.auth-message.success {
  color: #16a34a;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.field input,
.field select {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-size: 14px;
  background: #f9fafb;
}

.field .iti {
  width: 100%;
}

.field .iti input {
  width: 100%;
}

.password-field {
  position: relative;
  display: grid;
}

.password-field input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 999px;
}

.password-toggle:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.15);
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
}

.primary:hover {
  background: var(--primary-soft);
}

.ghost {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 8px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  cursor: pointer;
}

.ghost img {
  width: 18px;
  height: 18px;
}

.divider {
  position: relative;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

.helper {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.link {
  border: none;
  background: none;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  font-weight: 600;
}

.auth-footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
}

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
}

.auth-modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.auth-modal {
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  width: min(420px, 90vw);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  display: grid;
  gap: 12px;
}

.auth-modal h3 {
  margin: 0;
  font-size: 18px;
}

.auth-modal p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.auth-media-panel {
  padding: 28px;
  background: transparent;
  /* This is the actual grid item (auth-media-panel, not media-card inside
     it) that was observed changing size in DevTools despite media-card
     having a hard height - height alone wasn't a strong enough guarantee
     against something in this box's content still influencing its own
     size. contain: layout size is the explicit CSS primitive for exactly
     this: it hard-disconnects this box's size from its content entirely,
     in both directions - nothing inside can ever push it bigger or
     smaller, no matter what changes (slide text, image state, anything). */
  height: 576px;
  contain: layout size;
  overflow: hidden;
}

.media-card {
  background: linear-gradient(180deg, var(--navy), #111827);
  border-radius: 26px;
  padding: 26px;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 520px;
  contain: layout size;
  position: relative;
  overflow: hidden;
}

.media-slider {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 320px;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(circle at top, rgba(37, 99, 235, 0.28), transparent 60%);
}

.media-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.media-slide.active {
  opacity: 1;
}

.media-copy {
  /* Fixed height + overflow hidden + vertical centering: captions vary in
     length across slides (some wrap to 2 lines, some don't), and a
     min-height still lets the box grow taller for the longer ones, which
     pushes .media-card's total height around every 4s as the slider
     auto-advances - and since .media-card shares a CSS Grid row with the
     sign-in form (align-items: stretch), that resize was visibly shifting
     the form too. A hard height (generous enough for the longest caption
     used today, with headroom) keeps this box - and everything anchored to
     it - completely static regardless of which slide is active. */
  height: 90px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.media-copy h2 {
  margin: 0 0 8px;
}

.media-copy p {
  margin: 0;
  color: rgba(248, 250, 252, 0.7);
  font-size: 14px;
}

.media-dots {
  display: flex;
  gap: 6px;
}

.media-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(248, 250, 252, 0.35);
}

.media-dots span.active {
  background: var(--teal);
}




.site-credit {
  flex-shrink: 0;
  text-align: center;
  padding: 14px 16px 4px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.site-credit a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.site-credit a:hover {
  text-decoration: underline;
}
