/* fas-htmx portal styles
 * Cloned verbatim from fas-svelte/src/routes/+layout.svelte.
 * Svelte `:global(...)` selectors are unwrapped to plain selectors
 * since this stylesheet is loaded as a regular <link>.
 */

:root {
  --bg: #fff5f8;
  --bg-deep: #f8dce7;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --surface-dark: rgba(35, 10, 22, 0.76);
  --border: rgba(224, 30, 90, 0.14);
  --text: #241018;
  --muted: #735767;
  --accent: #e01e5a;
  --accent-strong: #a80f3d;
  --accent-soft: #fde8f0;
  --danger-soft: #fff0f4;
  --danger: #b31347;
  --shadow: 0 24px 80px rgba(101, 13, 47, 0.14);
  --font-body: 'Avenir Next', 'Segoe UI Variable Text', 'Trebuchet MS', sans-serif;
  --font-display: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(224, 30, 90, 0.16), transparent 30%),
    radial-gradient(circle at right 20%, rgba(45, 18, 68, 0.11), transparent 26%),
    linear-gradient(180deg, #fffafb 0%, var(--bg) 52%, var(--bg-deep) 100%);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(224, 30, 90, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(224, 30, 90, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 85%);
          mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 85%);
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 3vw, 40px);
  position: relative;
  z-index: 1;
}

.page-shell--top {
  align-items: start;
}

.panel {
  width: 100%;
  border-radius: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px);
          backdrop-filter: blur(18px);
}

.panel--wide {
  max-width: 1040px;
}

.panel--compact {
  max-width: 520px;
}

.panel-inner {
  padding: clamp(24px, 4vw, 40px);
}

.brand-lockup {
  display: inline-flex;
  align-items: start;
  gap: 14px;
  flex-direction: column;
}

.brand-logo {
  width: auto;
  height: 64px;
  object-fit: contain;
}

.landing-copy .brand-logo {
  height: clamp(78px, 7vw, 104px);
}

.brand-wordmark {
  display: grid;
  gap: 4px;
}

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--accent-strong);
  font-weight: 700;
}

.headline {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.headline--sm {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 1rem;
}

.kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.stack {
  display: grid;
  gap: 16px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-label {
  font-size: 0.92rem;
  letter-spacing: 0;
  color: var(--text);
}

.field-input {
  width: 100%;
  border: 1px solid rgba(38, 34, 28, 0.12);
  border-radius: 18px;
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.86);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.field-input::placeholder {
  color: #9a8f84;
}

.field-input:focus {
  outline: none;
  border-color: rgba(224, 30, 90, 0.48);
  box-shadow: 0 0 0 4px rgba(224, 30, 90, 0.12);
  transform: translateY(-1px);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, color 180ms ease,
    border-color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.button--primary {
  color: #fffdf8;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 14px 30px rgba(168, 15, 61, 0.24);
}

.button--secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(53, 42, 31, 0.12);
}

.button--ghost {
  color: #fffdf8;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.meta-card {
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(53, 42, 31, 0.08);
}

.meta-title {
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.meta-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.94rem;
}

.notice {
  padding: 16px 18px;
  border-radius: 22px;
  background: var(--accent-soft);
  border: 1px solid rgba(224, 30, 90, 0.16);
  color: #8f1239;
}

.error-box {
  padding: 16px 18px;
  border-radius: 22px;
  background: var(--danger-soft);
  border: 1px solid rgba(161, 61, 45, 0.16);
  color: var(--danger);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(53, 42, 31, 0.08);
  color: var(--muted);
  font-size: 0.92rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(224, 30, 90, 0.12);
}

.center {
  text-align: center;
}

.spinner {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  border: 2px solid rgba(224, 30, 90, 0.14);
  border-top-color: var(--accent);
  border-right-color: var(--accent-strong);
  animation: spin 900ms linear infinite;
}

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

/* Landing page */
.landing-panel {
  overflow: hidden;
}

.landing-grid {
  display: grid;
  gap: clamp(24px, 4vw, 48px);
}

.landing-copy {
  display: grid;
  gap: 28px;
  align-content: start;
}

.form-shell {
  padding: clamp(20px, 3vw, 26px);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(53, 42, 31, 0.08);
  display: grid;
  gap: 24px;
}

.form-copy {
  display: grid;
  gap: 10px;
}

.meta-index {
  display: none;
}

@media (min-width: 900px) {
  .landing-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    align-items: center;
  }

  .meta-index {
    display: grid;
  }
}

/* Authenticate page */
.auth-panel {
  display: grid;
  gap: 22px;
  text-align: center;
}

.auth-brand {
  justify-content: center;
}

.auth-head {
  display: grid;
  gap: 12px;
}

.spinner-wrap {
  display: grid;
  place-items: center;
  padding: 8px 0;
}

/* Terms page */
.legal-panel {
  display: grid;
  gap: 24px;
}

.legal-brand {
  justify-content: center;
}

.legal-copy {
  text-align: center;
}

/* Invalid page */
.invalid-panel {
  display: grid;
  gap: 24px;
  text-align: center;
}

.invalid-brand {
  justify-content: center;
}

.invalid-copy {
  justify-items: center;
}

/* Thank-you story page */
.story-page {
  position: relative;
  z-index: 1;
  width: 100vw;
  max-width: 100vw;
  overflow-x: clip;
}

.banner-stage {
  position: relative;
  width: 100vw;
  display: block;
  overflow: hidden;
  background: var(--bg);
}

.banner-stage--empty {
  background:
    radial-gradient(circle at top left, rgba(224, 30, 90, 0.28), transparent 32%),
    radial-gradient(circle at right 30%, rgba(255, 255, 255, 0.09), transparent 24%),
    linear-gradient(135deg, #170711 0%, #321124 100%);
}

.banner-image {
  display: block;
  width: 100vw;
  height: auto;
  max-width: none;
}

.banner-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: none;
}

.banner-stage--empty .banner-scrim {
  background:
    radial-gradient(circle at top left, rgba(224, 30, 90, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(19, 7, 16, 0.04) 0%, rgba(19, 7, 16, 0.28) 100%);
}

.banner-cta-button {
  width: 100%;
  min-height: 54px;
  border-radius: 18px;
  box-shadow: 0 14px 28px rgba(168, 15, 61, 0.22);
}

.portal-copyright {
  grid-column: 1 / -1;
  justify-self: stretch;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.banner-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  justify-items: center;
  padding: clamp(20px, 3.5vw, 42px);
  background:
    radial-gradient(circle at top left, rgba(224, 30, 90, 0.1), transparent 28%),
    linear-gradient(180deg, #fff8fa 0%, var(--bg) 100%);
  border-top: 1px solid rgba(224, 30, 90, 0.1);
  color: var(--text);
}

.access-preview-card {
  width: min(100%, 1120px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  align-items: center;
  gap: clamp(20px, 5vw, 64px);
  padding: clamp(10px, 2vw, 18px) 0;
}

.access-preview-form {
  display: grid;
  justify-items: stretch;
  gap: 12px;
  width: 100%;
}

.access-preview-actions {
  justify-self: end;
  width: min(100%, 380px);
  display: grid;
  gap: 12px;
}

.story-copy {
  max-width: 100%;
  display: grid;
  gap: 14px;
}

.story-copy .eyebrow {
  color: var(--accent);
}

.story-copy .headline {
  max-width: 680px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.02;
}

.banner-text {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 36rem;
}

@media (max-width: 640px) {
  .banner-copy {
    padding: 18px 16px 24px;
  }

  .access-preview-card {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 8px 0 0;
  }

  .access-preview-actions {
    justify-self: stretch;
    width: 100%;
  }

  .story-copy .headline {
    max-width: 14ch;
    font-size: clamp(2.2rem, 11vw, 3.1rem);
  }

  .banner-cta-button {
    width: 100%;
  }
}

/* Video modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 12, 15, 0.18);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
          backdrop-filter: blur(16px) saturate(120%);
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 28px);
  z-index: 30;
}

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

.modal-panel {
  width: min(100%, 800px);
  display: grid;
  gap: 18px;
  border-radius: 30px;
  box-shadow: 0 24px 80px rgba(18, 20, 24, 0.16);
}

.video-player {
  width: 100%;
  max-height: min(72vh, 760px);
  border-radius: 24px;
  background: #000;
  object-fit: cover;
}

.video-frame {
  position: relative;
}

.modal-overlay-form {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 2;
}

.modal-overlay-button {
  padding: 0 25px;
  box-shadow: 0 18px 38px rgba(168, 15, 61, 0.34);
}

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