:root {
  --paper: #f4f0e8;
  --mist: #e8e3d9;
  --stone: #d8d1c6;
  --ink: #12181d;
  --charcoal: #2a3137;
  --forest: #1f4d3e;
  --moss: #2e6a55;
  --rust: #c46a3a;
  --white: #fffdf8;
  --border: 1px solid rgba(18, 24, 29, 0.1);
  --shadow-soft: 0 24px 60px rgba(18, 24, 29, 0.08);
  --shadow-card: 0 16px 34px rgba(18, 24, 29, 0.06);
  --radius-xl: 36px;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --shell-width: 1160px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--ink);
  background:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E"),
    radial-gradient(circle at top left, rgba(196, 106, 58, 0.08), transparent 26%),
    radial-gradient(circle at bottom right, rgba(31, 77, 62, 0.09), transparent 24%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.78), rgba(255, 253, 248, 0.9)),
    repeating-linear-gradient(
      0deg,
      rgba(18, 24, 29, 0.012) 0,
      rgba(18, 24, 29, 0.012) 1px,
      transparent 1px,
      transparent 4px
    ),
    var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea {
  font: inherit;
}

button,
.button,
.nav-toggle {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(31, 77, 62, 0.45);
  outline-offset: 3px;
}

.page-shell {
  width: min(var(--shell-width), calc(100% - 24px));
  margin: 0 auto;
}

.site-header {
  padding: 18px 0 8px;
}

.header-shell {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 16px;
  padding: 0;
}

.brand-stack {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  align-items: center;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  display: inline-block;
  padding-bottom: 6px;
}

.brand-mark-image {
  padding-bottom: 0;
}

.brand-mark-image::after {
  display: none;
}

.brand-image {
  width: clamp(160px, 30vw, 192px);
  height: auto;
}

.fort-animation {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  margin-left: 0;
  font-size: 18px;
  line-height: 1.08;
  font-weight: 600;
  color: var(--ink);
  text-transform: none;
  letter-spacing: -0.02em;
  width: 100%;
  overflow: visible;
}

.fort-word {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  white-space: nowrap;
  animation: fadeWord 24s infinite;
}

.fort-letter {
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 3px;
}

@keyframes fadeWord {
  0%, 20%, 100% {
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
  }
  5%, 15% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.fort-word:nth-child(1) { animation-delay: 0s; }
.fort-word:nth-child(2) { animation-delay: 6s; }
.fort-word:nth-child(3) { animation-delay: 12s; }
.fort-word:nth-child(4) { animation-delay: 18s; }

.brand-mark::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--forest), var(--moss));
  transform-origin: left center;
  animation: drawUnderline 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes drawUnderline {
  0% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
}

.brand-tagline {
  margin: 0;
  color: rgba(18, 24, 29, 0.74);
  font-size: 0.92rem;
}

.nav-toggle {
  grid-column: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--ink);
  margin: 0;
}

.primary-nav {
  grid-column: 1 / -1;
  display: none;
  width: 100%;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(18, 24, 29, 0.08);
  margin-top: 8px;
}

.site-header[data-open="true"] .primary-nav {
  display: flex;
}

.nav-link,
.nav-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: 100%;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.nav-link {
  color: rgba(18, 24, 29, 0.8);
  border-color: rgba(18, 24, 29, 0.08);
}

.nav-link:hover,
.nav-link.is-active {
  background: rgba(31, 77, 62, 0.08);
  border-color: rgba(31, 77, 62, 0.15);
}

.nav-cta,
.button-primary {
  background: var(--ink);
  color: var(--white);
}

.nav-cta:hover,
.button-primary:hover {
  background: var(--forest);
}

.button-secondary {
  border-color: rgba(18, 24, 29, 0.12);
  background: rgba(255, 253, 248, 0.8);
}

.button-secondary:hover {
  background: rgba(31, 77, 62, 0.08);
  border-color: rgba(31, 77, 62, 0.18);
}

.button-inverted {
  background: var(--white);
  color: var(--ink);
  border-color: transparent;
}

.button-inverted:hover {
  background: var(--paper);
  color: var(--forest);
}

.button-large {
  font-size: 1.15rem;
  padding: 16px 28px;
  min-height: 56px;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(18, 24, 29, 0.08);
}

.hero-section,
.page-hero,
.content-section {
  padding: 24px 0;
}

.hero-shell,
.page-hero-shell {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: var(--border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.95), rgba(232, 227, 217, 0.88)),
    var(--white);
  box-shadow: var(--shadow-soft);
}

.side-panel,
.info-card,
.offer-card,
.step-card,
.contact-form-card,
.panel-list-item,
.note-card,
.cta-panel,
.flash {
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.eyebrow,
.section-kicker,
.note-label,
.card-number,
.offer-name,
.step-number {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--forest);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before,
.section-kicker::before {
  content: "";
  width: 32px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--forest), var(--rust));
}

h1,
h2,
h3 {
  margin: 0 0 14px;
  line-height: 1.08;
  letter-spacing: -0.05em;
}

h1 {
  font-size: clamp(2.35rem, 11vw, 4.8rem);
}

.hero-title-main,
.hero-title-sub {
  display: block;
}

.hero-title-sub {
  margin-top: 0.18em;
  font-size: 0.56em;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.95rem, 7vw, 3rem);
}

h3 {
  font-size: clamp(1.25rem, 4vw, 1.6rem);
}

.lede,
.section-copy,
.footer-copy,
.form-note,
.flash {
  font-size: clamp(1rem, 2.8vw, 1.1rem);
  color: rgba(18, 24, 29, 0.82);
}

.action-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.hero-notes {
  display: grid;
  gap: 14px;
}

.note-card {
  padding: 22px;
  background: rgba(255, 253, 248, 0.9);
}

.note-card p {
  margin: 6px 0 0;
}

.note-card-primary {
  background:
    linear-gradient(180deg, rgba(18, 24, 29, 0.98), rgba(31, 77, 62, 0.94));
  color: var(--white);
}

.note-card-primary p,
.note-card-primary h2,
.note-card-primary .note-label {
  color: var(--white);
}

.note-card-offset {
  background: rgba(255, 253, 248, 0.88);
}

.compact-list {
  padding: 0;
  margin: 14px 0 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.compact-list li {
  position: relative;
  padding-left: 22px;
}

.compact-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--rust);
}

.compact-list-spacious {
  gap: 12px;
}

.trust-band {
  padding: 12px 0 24px;
}

.trust-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--forest);
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0.85;
}

.trust-icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading-tight {
  margin-bottom: 14px;
}

.card-grid,
.offer-grid,
.step-grid {
  display: grid;
  gap: 16px;
}

.info-card,
.offer-card,
.step-card,
.side-panel {
  padding: 22px;
  background: rgba(255, 253, 248, 0.88);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-form-card {
  padding: 32px;
  background: rgba(255, 253, 248, 0.95);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft), 0 0 0 1px rgba(18, 24, 29, 0.04) inset;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-form-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 32px 80px rgba(18, 24, 29, 0.12), 0 0 0 1px rgba(31, 77, 62, 0.08) inset;
}

.info-card:hover,
.offer-card:hover,
.step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}

.offer-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.offer-card-content {
  display: flex;
  flex-direction: column;
}

.offer-cta {
  width: 100%;
  margin-top: auto;
}

.card-number,
.offer-name,
.step-number {
  margin-bottom: 10px;
}

.section-band {
  background: rgba(31, 77, 62, 0.04);
}

.split-layout {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: var(--border);
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 248, 0.82);
}

.panel-list {
  display: grid;
  gap: 12px;
}

.panel-list-item {
  padding: 16px 18px;
  background: rgba(255, 253, 248, 0.9);
  font-weight: 700;
}

.panel-list-item--with-icon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.file-row-with-icon {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.file-row-with-icon__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  min-width: 0;
  flex: 1;
}

.file-row-with-icon__name {
  font-weight: 700;
  word-break: break-word;
}

.file-row-with-icon__description {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(18, 24, 29, 0.68);
}

/* Downloads page (/filer/) */
.filer-page-title {
  margin: 0.1rem 0 0.45rem;
  font-size: clamp(1.65rem, 5.8vw, 2.5rem);
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.filer-availability-date {
  margin: 0 0 0.2rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(18, 24, 29, 0.64);
}

.filer-receiver-name {
  margin: 0 0 0.7rem;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(18, 24, 29, 0.72);
}

.filer-welcome-message {
  margin: 0.4rem 0 0;
  max-width: 42rem;
  text-align: left;
  white-space: pre-wrap;
  font-size: clamp(0.98rem, 2.3vw, 1.08rem);
}

.filer-page-intro {
  margin: 1rem 0 0;
}

.file-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--forest);
  opacity: 0.92;
}

.file-type-icon__svg {
  display: block;
  width: 1.85rem;
  height: 1.85rem;
}

.file-type-icon--compact .file-type-icon__svg {
  width: 1.3rem;
  height: 1.3rem;
}

.file-type-icon--compact {
  color: rgba(31, 77, 62, 0.88);
}

.cta-panel {
  display: grid;
  gap: 18px;
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(18, 24, 29, 0.98), rgba(31, 77, 62, 0.95));
  color: var(--white);
}

.cta-panel h2,
.cta-panel .section-copy,
.cta-panel .section-kicker {
  color: var(--white);
}

.cta-copy {
  color: rgba(255, 253, 248, 0.84);
}

.page-hero-shell,
.contact-layout {
  align-items: start;
}

.contact-layout {
  display: grid;
  gap: 18px;
}

.contact-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  padding-bottom: 24px; /* Reserve space for error messages */
}

.field-group label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--charcoal);
  margin-left: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.required-mark {
  color: #d94b38;
  font-size: 0.8rem;
  font-weight: 700;
}

.optional-mark {
  color: rgba(18, 24, 29, 0.45);
  font-size: 0.8rem;
  font-weight: 500;
}

.field-group input,
.field-group textarea {
  width: 100%;
  padding: 16px 20px;
  border: 1px solid rgba(18, 24, 29, 0.35);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.field-group input::placeholder,
.field-group textarea::placeholder {
  color: rgba(18, 24, 29, 0.4);
}

.field-group input:hover,
.field-group textarea:hover {
  border-color: rgba(18, 24, 29, 0.5);
}

.field-group textarea {
  resize: vertical;
  min-height: 156px;
}

.field-group input:focus,
.field-group textarea:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 4px rgba(31, 77, 62, 0.12);
  outline: none;
  background: #ffffff;
}

.field-group input.input-error,
.field-group textarea.input-error,
.field-group:has(.field-error) input,
.field-group:has(.field-error) textarea {
  border-color: #d94b38;
  background: #fffafa;
}

.field-group input.input-error:focus,
.field-group textarea.input-error:focus,
.field-group:has(.field-error) input:focus,
.field-group:has(.field-error) textarea:focus {
  border-color: #d94b38;
  box-shadow: 0 0 0 4px rgba(217, 75, 56, 0.12);
}

.field-group input.checkbox-input {
  width: 20px;
  height: 20px;
  padding: 0;
  margin: 0;
  border-radius: 4px;
  cursor: pointer;
  accent-color: var(--forest);
}

.field-error,
.form-errors {
  margin: 0;
  color: #d94b38;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.field-error {
  position: absolute;
  bottom: 0;
  left: 0;
  animation: slideUpFade 0.3s ease forwards;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.field-error::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d94b38;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.form-actions .button {
  width: 100%;
}

@media (min-width: 760px) {
  .form-actions .button {
    width: auto;
    min-width: 200px;
  }
}

.flash-wrap {
  padding-top: 18px;
}

.flash {
  padding: 16px 18px;
  background: rgba(255, 253, 248, 0.94);
}

.flash-success {
  border-color: rgba(31, 77, 62, 0.22);
  background: rgba(31, 77, 62, 0.08);
  color: var(--ink);
}

.site-footer {
  padding: 8px 0 34px;
}

.footer-shell {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 28px;
  background: var(--charcoal);
  box-shadow: var(--shadow-soft);
}

.footer-copy,
.footer-links a {
  color: rgba(255, 253, 248, 0.84);
}

.footer-shell .brand {
  width: max-content;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.96);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 253, 248, 0.1);
}

.footer-links a:hover {
  background: rgba(255, 253, 248, 0.08);
  color: var(--white);
}

@media (min-width: 760px) {
  .page-shell {
    width: min(var(--shell-width), calc(100% - 40px));
  }

  .header-shell {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .brand-stack {
    flex: 0 1 auto;
    text-align: left;
    align-items: flex-start;
  }

  .brand {
    flex-direction: row;
    align-items: center;
  }

  .fort-animation {
    height: 60px;
    margin-left: 16px;
    font-size: 28px;
    width: 250px;
    justify-content: flex-start;
  }

  .fort-word {
    left: 0;
    transform: translateY(4px);
  }

  @keyframes fadeWord {
    0%, 20%, 100% {
      opacity: 0;
      transform: translateY(4px);
    }
    5%, 15% {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav-toggle {
    display: none;
  }

  .primary-nav {
    display: flex;
    width: auto;
    flex-direction: row;
    align-items: center;
    padding-top: 0;
    border-top: none;
    margin-top: 0;
  }

  .nav-link,
  .nav-cta,
  .button {
    width: auto;
  }

  .action-row,
  .footer-links {
    flex-direction: row;
  }

  .card-grid,
  .step-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .offer-grid,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 940px) {
  .hero-shell,
  .page-hero-shell,
  .contact-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 24px;
    padding: 34px;
  }

  .split-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
    align-items: start;
  }

  .offer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .offer-card:nth-child(even).is-visible {
    transform: translateY(16px);
  }

  .offer-card:nth-child(even).is-visible:hover {
    transform: translateY(12px);
  }

  .note-card-offset {
    transform: translateX(-18px) rotate(-2deg);
  }

  .note-card-primary {
    transform: rotate(1.5deg);
    z-index: 2;
    position: relative;
  }
  
  /* Counter-rotate the tooltip so it appears horizontally aligned */
  .note-card-primary .info-tooltip-text {
    transform: translateX(-50%) translateY(10px) rotate(-1.5deg);
  }
  
  .note-card-primary .info-tooltip:hover .info-tooltip-text,
  .note-card-primary .info-tooltip:focus .info-tooltip-text,
  .note-card-primary .info-tooltip.auto-open .info-tooltip-text {
    transform: translateX(-50%) translateY(0) rotate(-1.5deg);
  }
}

/* Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.section-heading.reveal,
.trust-band.reveal {
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* AI/KI Swap Animation */
.ai-swap {
  position: relative;
  display: inline-block;
  text-decoration: underline;
  text-decoration-color: #1f4d3e;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.ai-swap::before {
  content: attr(data-word1);
  animation: swapAi 10s infinite;
}

.ai-swap::after {
  content: attr(data-word2);
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  text-decoration: underline;
  text-decoration-color: #1f4d3e;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  animation: swapKi 10s infinite;
}

@keyframes swapAi {
  0%, 45% { opacity: 1; }
  50%, 95% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes swapKi {
  0%, 45% { opacity: 0; }
  50%, 95% { opacity: 1; }
  100% { opacity: 0; }
}

/* HTMX Loading State */
.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator {
  display: flex !important;
}
.htmx-request.htmx-indicator {
  display: flex !important;
}
.htmx-request .form-content {
  display: none !important;
}

.form-loading {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 24px;
  text-align: center;
  min-height: 300px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(31, 77, 62, 0.15);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-messages {
  position: relative;
  height: 28px;
  width: 100%;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.loading-messages .msg {
  position: absolute;
  font-weight: 600;
  color: var(--forest);
  font-size: 1.15rem;
  opacity: 0;
  transform: translateY(10px);
}

.htmx-request .msg-1 {
  animation: msgFadeInOut 1.5s forwards;
}
.htmx-request .msg-2 {
  animation: msgFadeInOut 1.5s 1.5s forwards;
}
.htmx-request .msg-3 {
  animation: msgFadeIn 0.3s 3.0s forwards;
}

@keyframes msgFadeInOut {
  0% { opacity: 0; transform: translateY(10px); }
  15% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}
@keyframes msgFadeIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Info Tooltip */
.info-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: super;
  margin: 0 4px;
  color: var(--white);
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
  top: 0;
}

.info-tooltip:hover,
.info-tooltip:focus {
  color: var(--mist);
  outline: none;
}

.info-tooltip svg {
  width: 18px;
  height: 18px;
}

.info-tooltip-text {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-80%) translateY(10px);
  width: max-content;
  max-width: 280px;
  background: rgba(255, 253, 248, 0.85);
  color: var(--ink);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(18, 24, 29, 0.12);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
  pointer-events: none;
  font-family: "Manrope", "Segoe UI", sans-serif;
  letter-spacing: normal;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.info-tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 80%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(255, 253, 248, 0.85) transparent transparent transparent;
}

.info-tooltip:hover .info-tooltip-text,
.info-tooltip:focus .info-tooltip-text,
.info-tooltip.auto-open .info-tooltip-text {
  opacity: 1;
  visibility: visible;
  transform: translateX(-80%) translateY(0);
}

@media (min-width: 760px) {
  .info-tooltip-text {
    transform: translateX(-50%) translateY(10px);
  }
  .info-tooltip-text::after {
    left: 50%;
  }
  .info-tooltip:hover .info-tooltip-text,
  .info-tooltip:focus .info-tooltip-text,
  .info-tooltip.auto-open .info-tooltip-text {
    transform: translateX(-50%) translateY(0);
  }
}
