/* ============================================================
   Runpod auth page replica
   Design tokens taken from console.runpod.io (Clerk appearance):
   violet #5F4CFE / hover #4D38F5, background #F2F5F9,
   footer #F7F7F7, borders rgba(107,114,128,.2), Inter, 3.5px radii
   ============================================================ */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
}

/* Light theme = the values the live page renders with
   prefers-color-scheme: light. Everything that changes between the two
   schemes is a token, so the dark block below is the only difference. */
:root {
  color-scheme: light;

  --violet: #5F4CFE;
  --violet-hover: #4D38F5;
  --violet-secondary: #9289FE;
  --link: #5F4CFE;

  --page-bg: #F2F5F9;
  --card-bg: #FFFFFF;
  --card-border: rgba(107, 114, 128, 0.2);
  --card-ring: rgba(0, 0, 0, 0.03);

  --text: #000000;
  --text-secondary: rgba(0, 0, 0, 0.75);
  --text-muted: rgba(0, 0, 0, 0.41);

  --input-ring: rgba(55, 65, 81, 0.1);
  --divider: rgba(0, 0, 0, 0.07);
  --soft-bg: rgba(55, 65, 81, 0.05);
  --soft-bg-hover: rgba(55, 65, 81, 0.1);
  --social-text: #181818;

  /* the footer is the card colour plus a 3% tint of the opposite colour */
  --footer-tint: rgba(0, 0, 0, 0.03);
  --footer-border: #EFEFEF;

  --hairline: rgba(0, 0, 0, 0.06);
  --hover-tint: rgba(0, 0, 0, 0.04);
  --icon-bg: rgba(95, 76, 254, 0.08);
  --danger: #D32F2F;
  --overlay: rgba(0, 0, 0, 0.5);

  --font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* Dark theme = console.runpod.io/login with prefers-color-scheme: dark
   (page #121212, card #181818, accents switch to #9289FE). Every value
   below was sampled from the live page / its computed styles. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --link: #9289FE;

    --page-bg: #121212;
    --card-bg: #181818;
    --card-border: rgba(107, 114, 128, 0.2);
    --card-ring: rgba(255, 255, 255, 0.03);

    --text: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-muted: rgba(255, 255, 255, 0.41);

    --input-ring: rgba(156, 163, 175, 0.1);
    --divider: rgba(255, 255, 255, 0.07);
    --soft-bg: rgba(156, 163, 175, 0.05);
    --soft-bg-hover: rgba(156, 163, 175, 0.1);
    --social-text: #FEFEFE;

    --footer-tint: rgba(255, 255, 255, 0.03);
    --footer-border: #262626;

    --hairline: rgba(255, 255, 255, 0.08);
    --hover-tint: rgba(255, 255, 255, 0.06);
    --icon-bg: rgba(146, 137, 254, 0.12);
    --danger: #F87171;
    --overlay: rgba(0, 0, 0, 0.65);
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 350;
  line-height: 1.5;
  color: var(--text);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input { font-family: inherit; }

/* ---------- Layout ---------- */

.auth-layout {
  display: flex;
  min-height: 100vh;
}

.auth-panel {
  flex: 0 0 50%;
  max-width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ---------- Auth card (Clerk clone) ---------- */

.auth-card {
  width: 350px;
  max-width: 100%;
  /* transparent box: the white paint comes from .auth-card-inner, exactly
     like Clerk's .cl-cardBox / .cl-card pair — otherwise the 20% grey
     border would composite over white instead of the page background */
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: 3.5px;
  overflow: hidden;
}

/* Clerk's own card metrics: 28px / 35px padding (--clerk-spacing: 14px),
   gap 28px between blocks, radius 0.333333rem, 1px ring shadow */
.auth-card-inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin: -1px;
  padding: 28px 35px;
  background: var(--card-bg);
  border-radius: 4.66667px;
  box-shadow: 0 0 0 1px var(--card-ring);
}

.auth-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 21px;
  text-align: center;
}

.auth-logo-box {
  display: flex;
  flex-flow: row;
  align-items: stretch;
  justify-content: center;
  height: 42px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.auth-logo img {
  display: block;
  height: 42px;
  width: auto;
}

.auth-header-text {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  /* 3.5px in Clerk's stylesheet, 2.5px here: the live subtitle is painted
     one pixel higher than a 3.5px gap produced in this layout (verified
     against the reference screenshots in both colour schemes) */
  gap: 2.5px;
}

/* ---------- Social providers + divider (as on the live page) ---------- */

.auth-main {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 21px;
}

.auth-social {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
}

.auth-social-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  justify-content: center;
  align-items: stretch;
}

.btn-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  min-height: 30px;
  padding: 5.25px 10.5px;
  font-family: inherit;
  font-size: 11.375px;
  font-weight: 500;
  letter-spacing: normal;
  line-height: 15.75px;
  color: var(--social-text);
  background: var(--soft-bg);
  border: 0;
  border-radius: 3.5px;
  box-shadow: inset 0 0 0 1px rgba(107, 114, 128, 0.1);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-social:hover { background: var(--soft-bg-hover); }

.btn-social:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 1px;
}

.btn-social:disabled { opacity: 0.5; cursor: default; }

/* the provider button replaces its brand icon with a spinner while the
   "existing session" is being authorised */
.social-spinner {
  display: none;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(107, 114, 128, 0.35);
  border-top-color: var(--social-text);
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  flex: 0 0 auto;
}

.btn-social.is-loading .social-spinner { display: inline-block; }
.btn-social.is-loading .social-icon { display: none; }

.social-inner {
  display: flex;
  flex-flow: row;
  align-items: center;
  justify-content: center;
  gap: 10.5px;
  width: 100%;
}

.social-icon {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
}

.social-icon svg { display: block; }

.social-label {
  margin: 0;
  font-size: 11.375px;
  font-weight: 500;
  line-height: 15.75px;
  color: inherit;
}

.auth-divider {
  display: flex;
  flex-flow: row;
  align-items: center;
  justify-content: center;
}

.divider-line {
  flex: 1 1 auto;
  height: 1px;
  background: var(--divider);
}

.divider-text {
  margin: 0 14px;
  font-size: 11.375px;
  font-weight: 400;
  line-height: 15.75px;
  color: var(--text-secondary);
}

.auth-title {
  margin: 0;
  font-size: 14.875px;
  font-weight: 700;
  line-height: 21px;
  color: var(--text);
}

.auth-subtitle {
  margin: 0;
  font-size: 11.375px;
  font-weight: 400;
  line-height: 15.75px;
  color: var(--text-secondary);
}

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

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
  /* the shorter header gap above is paid back here, so the email field,
     the button and the footer stay on their exact reference rows */
  margin-top: 1px;
}

.form-fields {
  display: flex;
  flex-direction: column;
  gap: 21px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-label {
  font-size: 11.375px;
  font-weight: 500;
  line-height: 15.75px;
  color: var(--text);
}

.form-input {
  width: 100%;
  min-height: 30px;
  /* the live field sits 1px higher in the flow while the placeholder
     keeps its baseline: pulled up by the negative margin and paid back
     with the top padding (the min-height still governs the box size) */
  margin-top: -1px;
  padding: 6.25px 10.5px 4.25px;
  font-size: 11.375px;
  font-weight: 400;
  line-height: 15.75px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 3.5px;
  box-shadow: 0 0 0 1px var(--input-ring);
  outline: none;
  transition: box-shadow 0.12s ease;
}

.form-input::placeholder { color: var(--text-secondary); }

.form-input:focus { box-shadow: 0 0 0 1px var(--violet); }

.form-input.is-invalid { box-shadow: 0 0 0 1px var(--danger); }

.form-error {
  margin: 0;
  font-size: 11.375px;
  line-height: 15.75px;
  color: var(--danger);
}

.form-error[hidden] { display: none; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 30px;
  padding: 5.25px 10.5px;
  font-size: 11.375px;
  font-weight: 500;
  line-height: 15.75px;
  border: 0;
  border-radius: 3.5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 1px;
}

/* Clerk solid primary button — the live page paints it flat #5F4CFE:
   no outer ring and no drop shadow (verified pixel-by-pixel against
   the original screenshot, the button edge is a hard aliased line) */
.btn-primary {
  background-color: var(--violet);
  color: #FFFFFF;
  /* Clerk paints a 10%-violet 1px ring around the solid button: in light
     mode it shows up as #EFEDFF, in dark as #1F1D2F (both sampled from
     the live page) */
  box-shadow: 0 0 0 1px rgba(95, 76, 254, 0.1);
}

.btn-primary:hover { background-color: var(--violet-hover); }

.btn-primary:active { background-color: rgba(77, 56, 245, 0.9); }

.btn-secondary {
  background: var(--soft-bg);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(107, 114, 128, 0.1);
}

.btn-secondary:hover { background: var(--soft-bg-hover); }

.btn:disabled { opacity: 0.7; cursor: default; }

.auth-continue {
  width: 100%;
  /* the live button is painted at 562.5px, so its label sits one pixel
     lower than plain flex centring gives; the box keeps its 30px height */
  padding: 6.25px 10.5px 4.25px;
}

.btn-spinner {
  display: none;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  flex: 0 0 auto;
}

.btn.is-loading .btn-spinner { display: inline-block; }

.btn.is-loading { pointer-events: none; }

.btn-check { display: none; color: #FFFFFF; }
.btn-check svg { display: block; }
.btn.is-done .btn-check { display: inline-flex; }
.btn.is-done .btn-spinner { display: none; }
.btn.is-done { background: var(--violet); }

@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ---------- Card footer ---------- */

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3.5px;
  padding: 14px 28px;
  background: linear-gradient(var(--footer-tint), var(--footer-tint)), var(--card-bg);
  border-top: 1px solid var(--footer-border);
  font-size: 11.375px;
  font-weight: 400;
  line-height: 15.75px;
  color: var(--text-secondary);
}

.footer-link {
  color: var(--link);
  font-weight: 500;
  text-decoration: none;
}

.footer-link:hover { text-decoration: underline; }
.footer-link:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; border-radius: 2px; }
/* ---------- Story (testimonial) panel ---------- */

.story-panel {
  position: relative;
  flex: 0 0 50%;
  max-width: 50%;
  overflow: hidden;
  background: #000000;
}

.story-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.story-image.is-fading { opacity: 0; }

.story-gradient {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 66.6667%;
  z-index: 1;
  background: linear-gradient(to top, #000000 25%, rgba(0, 0, 0, 0) 100%);
}

/* Panel matches the live page: absolute bottom block, 84px side/bottom
   margins, 56px gap, 28px gap inside, logo 98px wide, dots bottom-right */
.story-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 56px;
  margin-bottom: 84px;
}

.story-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 28px;
  margin: 0 42px;
}

.story-logo {
  display: block;
  width: 98px;
  height: auto;
}

.story-quote {
  display: block;
  margin: 0;
  color: #FFFFFF;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
}

.story-quote:hover { text-decoration: underline; }

.story-bottom {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  margin: 0 42px;
}

.story-person {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 91px;
}

.story-name {
  margin: 0;
  color: #FFFFFF;
  font-size: 16px;
  line-height: 24px;
}

.story-role {
  margin: 0;
  color: #FFFFFF;
  opacity: 0.5;
  font-size: 12.25px;
  line-height: 17.5px;
}

.story-dots {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: row;
  gap: 10.5px;
  margin: 0 42px 84px;
}

.story-dot {
  position: relative;
  width: 10.5px;
  height: 10.5px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  overflow: hidden;
  cursor: pointer;
  transition: width 0.25s ease, background-color 0.25s ease;
}

.story-dot:hover { background: rgba(255, 255, 255, 0.8); }

/* The active dot is a 49px track (3.5rem at Clerk's 14px root size) whose
   inner white bar fills up over the slide duration, exactly like the live
   page (button width 3.5rem, inner div width 0% → 100%). */
.story-dot.is-active { width: 49px; }

.story-dot-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: #FFFFFF;
}

.story-dot.is-active .story-dot-fill {
  animation: story-progress 7s linear forwards;
}

@keyframes story-progress {
  from { width: 0%; }
  to { width: 100%; }
}

/* ---------- Cookie banner ---------- */

.cookie-banner {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 60;
  width: calc(100% - 28px);
  max-width: 336px;
  padding: 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 3.5px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.cookie-banner[hidden] { display: none; }

.cookie-title {
  margin: 0;
  font-size: 12.25px;
  font-weight: 400;
  line-height: 17.5px;
}

.cookie-text {
  margin: 3.5px 0 0;
  font-size: 12.25px;
  font-weight: 350;
  line-height: 17.5px;
  opacity: 0.75;
}

.cookie-actions {
  display: flex;
  gap: 7px;
  margin-top: 10.5px;
}

.btn-cookie {
  font-size: 14px;
  font-weight: 450;
  min-height: 30px;
  padding: 4.2px 14px;
}

/* ---------- Restriction modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay[hidden] { display: none; }

.modal-overlay.is-open { opacity: 1; }

.modal {
  position: relative;
  width: 350px;
  max-width: 100%;
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  padding: 28px 35px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 3.5px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s ease;
}

.modal-overlay.is-open .modal { transform: none; }

.modal-close {
  position: absolute;
  top: 10.5px;
  right: 10.5px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  color: var(--text-muted);
  border: 0;
  border-radius: 3.5px;
  cursor: pointer;
  transition: color 0.12s ease, background-color 0.12s ease;
}

.modal-close:hover { color: var(--text); background: var(--hover-tint); }

.modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.modal-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--link);
  background: var(--icon-bg);
  border-radius: 50%;
}

.modal-title {
  margin: 0;
  font-size: 14.875px;
  font-weight: 700;
  line-height: 21px;
}

.modal-subtitle {
  margin: 4px 0 0;
  font-size: 11.375px;
  font-weight: 400;
  line-height: 15.75px;
  color: var(--text-secondary);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 10.5px;
  margin-top: 14px;
}

.modal-body p {
  margin: 0;
  font-size: 12.25px;
  font-weight: 400;
  line-height: 17.5px;
}

.case-box {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 10.5px 14px;
  background: var(--soft-bg);
  border-radius: 3.5px;
}

.case-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.375px;
  line-height: 15.75px;
}

.case-row dt { color: var(--text-secondary); flex: 0 0 auto; }

.case-row dd {
  margin: 0;
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

.modal-actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}

.modal-download {
  width: 100%;
  min-height: 34px;
  padding: 8px 14px;
  font-size: 12.25px;
  line-height: 16px;
  border-radius: 3.5px;
}

.file-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 10.5px 0 0;
  font-size: 11.375px;
  line-height: 15.75px;
  color: var(--text-secondary);
}

.file-meta svg { flex: 0 0 auto; }

.modal-note {
  margin: 14px 0 0;
  font-size: 11.375px;
  line-height: 15.75px;
  color: var(--text-secondary);
  text-align: center;
}

/* ---------- OAuth (provider session) modal ---------- */

.oauth-badge {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.oauth-badge svg { display: block; }

.oauth-badge.is-github {
  background: #24292F;
  color: #FFFFFF;
}

.oauth-badge.is-google {
  background: #FFFFFF;
  box-shadow: inset 0 0 0 1px rgba(107, 114, 128, 0.2);
}

.session-strip {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 7px 10.5px;
  background: var(--soft-bg);
  border-radius: 3.5px;
  font-size: 11.375px;
  line-height: 15.75px;
  color: var(--text-secondary);
}

.session-strip svg { flex: 0 0 auto; color: var(--link); }

/* ---------- Responsive ---------- */

@media (min-width: 1280px) {
  .story-inner,
  .story-bottom { margin: 0 84px; }
  .story-dots { margin: 0 84px 84px; }
  .story-quote { font-size: 32px; line-height: 48px; }
}

@media (min-width: 1536px) {
  .story-quote { font-size: 46px; }
}

@media (max-width: 1023.98px) {
  .story-panel { display: none; }
  .auth-panel { flex: 1 1 100%; max-width: 100%; }
}

@media (max-width: 420px) {
  .auth-card { width: 100%; }
  .auth-card-inner { padding: 24px; }
  .auth-panel { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  /* the slide timer still drives the carousel, so keep the bar readable */
  .story-dot.is-active .story-dot-fill {
    animation: none !important;
    width: 100%;
  }
}

