/* ── Reset & Base ─────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Palette — neutral base */
  --color-canvas: #ffffff;
  --color-surface-soft: #f8fafc;
  --color-surface-strong: #e0e2e6;
  --color-ink: #181d26;
  --color-body: #333840;
  --color-muted: #41454d;
  --color-hairline: #dddddd;

  /* Accent — brand voltage */
  --color-accent: #B9373A;
  --color-accent-active: #9a2d30;
  --color-accent-light: rgba(185, 55, 58, 0.08);

  /* Typography */
  --font-sans: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;

  --text-display: 2rem;      /* 32px */
  --text-title: 1.25rem;     /* 20px */
  --text-body: 1rem;         /* 16px */
  --text-small: 0.875rem;    /* 14px */

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-large: 600;

  --leading-tight: 1.2;
  --leading-normal: 1.4;

  /* Spacing — 4px base */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;

  /* Radius */
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-button: 0 2px 8px rgba(185, 55, 58, 0.15);
  --shadow-button-active: 0 1px 4px rgba(185, 55, 58, 0.2);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-weight: var(--weight-regular);
  color: var(--color-body);
  background-color: var(--color-surface-soft);
  line-height: var(--leading-normal);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
}

/* ── Container ────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xxl) var(--space-lg);
  background-color: var(--color-canvas);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

/* ── Logo ─────────────────────────────────────────── */
.logo {
  width: 55%;
  max-width: 320px;
  height: auto;
}

/* ── Heading ──────────────────────────────────────── */
h1 {
  color: var(--color-muted);
  font-size: 1.25rem;
  font-weight: var(--weight-larger);
  text-align: center;
  line-height: var(--leading-normal);
  margin: 0;
}

/* ── Chat label ───────────────────────────────────── */
#chat-label {
  color: var(--color-accent);
  font-size: var(--text-small);
  font-weight: var(--weight-medium);
  text-align: center;
  margin-top: var(--space-xs);
  margin-bottom: 0;
}

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  line-height: var(--leading-normal);
  text-decoration: none;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease,
    transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Primary — accent color */
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-canvas);
  box-shadow: var(--shadow-button);
}

.btn-primary:active {
  background-color: var(--color-accent-active);
  box-shadow: var(--shadow-button-active);
  transform: scale(0.98);
}

/* Secondary — neutral outline */
.btn-secondary {
  background-color: var(--color-canvas);
  color: var(--color-ink);
  border: 1px solid var(--color-hairline);
}

.btn-secondary:active {
  background-color: var(--color-surface-soft);
  border-color: var(--color-surface-strong);
  transform: scale(0.98);
}

/* Focus visible */
.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ── Back link ────────────────────────────────────── */
.link-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
  font-size: var(--text-small);
  font-weight: var(--weight-medium);
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.link-back:hover,
.link-back:active {
  color: var(--color-accent);
}

.link-back .icon-small {
  width: 16px;
  height: 16px;
}

.link-back:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Responsive ───────────────────────────────────── */
@media (min-width: 768px) {
  body {
    padding: var(--space-xxl);
  }

  .container {
    padding: var(--space-xxl) var(--space-xl);
    max-width: 480px;
  }

  .logo {
    width: 55%;
    max-width: 320px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 520px;
  }
}

/* ── Chat Modal ───────────────────────────────────── */
.chat-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.2s ease, opacity 0.2s ease;
}

.chat-modal.is-open {
  visibility: visible;
  opacity: 1;
}

.chat-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.chat-modal-content {
  position: relative;
  width: 90vw;
  max-width: 420px;
  height: 80vh;
  max-height: 600px;
  background: var(--color-canvas);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.chat-modal-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.6);
  color: var(--color-canvas);
  cursor: pointer;
  transition: background 0.15s ease;
}

.chat-modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

.chat-modal-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

@media (min-width: 768px) {
  .chat-modal-content {
    max-width: 460px;
    height: 85vh;
    max-height: 680px;
  }
}

#chat-label{
  padding-bottom: -2%;
  margin-bottom: -2%;
}

/* ── Intro Animation Overlay ──────────────────────── */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--color-canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: intro-fade 2.2s 1.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

.intro-line {
  position: absolute;
  height: 2px;
  background: var(--color-accent);
  transform-origin: left center;
  transform: rotate(-35deg);
  width: 0;
  opacity: 0;
}

.intro-line-1 {
  top: 12%;
  left: -10%;
  animation: line-sweep-1 1.1s 0.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro-line-2 {
  top: 28%;
  left: -10%;
  animation: line-sweep-2 1.2s 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro-line-3 {
  top: 44%;
  left: -10%;
  animation: line-sweep-3 1.15s 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro-line-4 {
  top: 60%;
  left: -10%;
  animation: line-sweep-4 1.05s 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro-line-5 {
  top: 76%;
  left: -10%;
  animation: line-sweep-5 1.1s 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro-line-6 {
  top: 92%;
  left: -10%;
  animation: line-sweep-6 1.0s 1.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes line-sweep-1 {
  0% {
    width: 0;
    opacity: 0;
    transform: rotate(-35deg) translateX(-10%);
  }
  10% {
    opacity: 1;
  }
  60% {
    width: 140vw;
    opacity: 1;
    transform: rotate(-35deg) translateX(0);
  }
  100% {
    width: 140vw;
    opacity: 0;
    transform: rotate(-35deg) translateX(5%);
  }
}

@keyframes line-sweep-2 {
  0% {
    width: 0;
    opacity: 0;
    transform: rotate(-35deg) translateX(-10%);
  }
  10% {
    opacity: 1;
  }
  60% {
    width: 140vw;
    opacity: 1;
    transform: rotate(-35deg) translateX(0);
  }
  100% {
    width: 140vw;
    opacity: 0;
    transform: rotate(-35deg) translateX(5%);
  }
}

@keyframes line-sweep-3 {
  0% {
    width: 0;
    opacity: 0;
    transform: rotate(-35deg) translateX(-10%);
  }
  10% {
    opacity: 1;
  }
  60% {
    width: 140vw;
    opacity: 1;
    transform: rotate(-35deg) translateX(0);
  }
  100% {
    width: 140vw;
    opacity: 0;
    transform: rotate(-35deg) translateX(5%);
  }
}

@keyframes line-sweep-4 {
  0% {
    width: 0;
    opacity: 0;
    transform: rotate(-35deg) translateX(-10%);
  }
  10% {
    opacity: 1;
  }
  60% {
    width: 140vw;
    opacity: 1;
    transform: rotate(-35deg) translateX(0);
  }
  100% {
    width: 140vw;
    opacity: 0;
    transform: rotate(-35deg) translateX(5%);
  }
}

@keyframes line-sweep-5 {
  0% {
    width: 0;
    opacity: 0;
    transform: rotate(-35deg) translateX(-10%);
  }
  10% {
    opacity: 1;
  }
  60% {
    width: 140vw;
    opacity: 1;
    transform: rotate(-35deg) translateX(0);
  }
  100% {
    width: 140vw;
    opacity: 0;
    transform: rotate(-35deg) translateX(5%);
  }
}

@keyframes line-sweep-6 {
  0% {
    width: 0;
    opacity: 0;
    transform: rotate(-35deg) translateX(-10%);
  }
  10% {
    opacity: 1;
  }
  60% {
    width: 140vw;
    opacity: 1;
    transform: rotate(-35deg) translateX(0);
  }
  100% {
    width: 140vw;
    opacity: 0;
    transform: rotate(-35deg) translateX(5%);
  }
}

@keyframes intro-fade {
  0%, 80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}
