/* Welcome panel */

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(0.65rem, 2.4vw, 1.25rem);
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
  opacity: 1;
  transition: opacity 320ms ease;
}

.welcome-overlay.is-open {
  display: flex;
}

.welcome-overlay.is-closing {
  opacity: 0;
}

.welcome-panel {
  width: min(700px, 100%);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  position: relative;
  margin: auto;
}

/* Split layout: left image | center content | right image */
.welcome-panel__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 700 / 380;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(0, 420px) minmax(110px, 1fr);
  align-items: stretch;
  justify-items: stretch;
}

/* ── TV / large screens (≥ 1800px) ─────────────────────── */
@media (min-width: 1800px) {
  .welcome-panel {
    width: min(860px, 90%);
  }

  .welcome-panel__frame {
    aspect-ratio: 860 / 420;
    grid-template-columns: minmax(140px, 1fr) minmax(0, 500px) minmax(140px, 1fr);
  }
}

.welcome-panel__side {
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.welcome-panel__side--left {
  background-image: url("../assets/welcome-split-left.png");
}

.welcome-panel__side--right {
  background-image: url("../assets/welcome-split-right.png");
}

/* Middle slice */
.welcome-panel__center {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0;
  background: #ffffff;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-panel__content {
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
  text-align: center;
  color: #2d2d2d;
  padding: clamp(0.9rem, 2.5vw, 1.4rem);
}

.welcome-panel__logo {
  width: min(180px, 65%);
  height: auto;
  display: block;
  margin: 0 auto 0.75rem;
}

.welcome-panel__headline {
  margin: 0.2rem 0 0.6rem;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  font-weight: 700;
  color: #2d2d2d;
  line-height: 1.28;
}

.welcome-panel__text {
  margin: 0;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.6;
  color: #4a4a4a;
}

.welcome-panel__text + .welcome-panel__text {
  margin-top: 0.5rem;
}

.welcome-panel__text--lead {
  margin-top: 0.65rem;
}

.welcome-panel__form {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.welcome-panel__stats {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  align-items: center;
  justify-items: center;
}

.welcome-panel__stat {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2d2d2d;
}

.welcome-panel__input {
  width: min(260px, 100%);
  min-height: 40px;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid #d2d2d2;
  background: #fff;
  color: #2d2d2d;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.875rem;
}

.welcome-panel__input:focus {
  outline: 2px solid rgba(196, 30, 58, 0.35);
  outline-offset: 2px;
  border-color: #c41e3a;
}

.welcome-panel__btn {
  min-height: 40px;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: none;
  background: #e31e2f;
  color: #fff;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.welcome-panel__btn:hover {
  background: #c91828;
  transform: translateY(-1px);
}

.welcome-panel__fine {
  margin: 0.8rem 0 0;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 400;
  color: #2d2d2d;
}

.welcome-panel__close-bottom {
  margin-top: 0.75rem;
  min-height: 40px;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.04);
  color: #2d2d2d;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.welcome-panel__close-bottom:hover {
  background: rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.welcome-panel__close-bottom:focus-visible {
  outline: 2px solid rgba(196, 30, 58, 0.45);
  outline-offset: 3px;
}

.welcome-panel__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.welcome-panel__close:hover {
  background: #fff;
  transform: translateY(-1px);
}

.welcome-panel__close:focus-visible {
  outline: 2px solid rgba(196, 30, 58, 0.45);
  outline-offset: 3px;
}

/* Keep panel light in dark theme */
:root[data-theme="dark"] .welcome-panel { background: #fff; }
:root[data-theme="dark"] .welcome-panel__frame { background-color: #fff; }
:root[data-theme="dark"] .welcome-panel__center { background: #fff; }
:root[data-theme="dark"] .welcome-panel__content { color: #2d2d2d; }
:root[data-theme="dark"] .welcome-panel__headline,
:root[data-theme="dark"] .welcome-panel__fine { color: #2d2d2d; }
:root[data-theme="dark"] .welcome-panel__text { color: #4a4a4a; }
:root[data-theme="dark"] .welcome-panel__input { background: #fff; border-color: #d2d2d2; color: #2d2d2d; }
:root[data-theme="dark"] .welcome-panel__close { background: rgba(255, 255, 255, 0.92); color: #000; }

/* ── Tablet (≤ 760px): collapse side artwork ──────────── */
@media (max-width: 760px) {
  .welcome-panel {
    border-radius: 12px;
  }

  .welcome-panel__frame {
    aspect-ratio: auto;
    grid-template-columns: 1fr;
  }

  .welcome-panel__side {
    display: none;
  }

  .welcome-panel__center {
    width: 100%;
  }
}

/* ── Small phone (≤ 480px) ──────────────────────────────── */
@media (max-width: 480px) {
  .welcome-overlay {
    padding: 0.5rem;
  }

  .welcome-panel {
    border-radius: 10px;
  }

  .welcome-panel__content {
    padding: 1.1rem 1rem 1rem;
  }

  .welcome-panel__logo {
    width: min(155px, 55%);
    margin-bottom: 0.6rem;
  }

  .welcome-panel__headline {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
  }

  .welcome-panel__text {
    font-size: 0.8125rem;
  }

  .welcome-panel__form {
    flex-direction: column;
    gap: 0.45rem;
  }

  .welcome-panel__input,
  .welcome-panel__btn {
    width: 100%;
  }

  .welcome-panel__close-bottom {
    width: 100%;
    margin-top: 0.6rem;
  }

  .welcome-panel__stats {
    gap: 0.45rem;
  }
}

/* ── Landscape phones (short viewport ≤ 480px height) ───── */
@media (max-height: 480px) {
  .welcome-overlay {
    align-items: flex-start;
    padding: 0.5rem;
  }

  .welcome-panel {
    margin: 0 auto;
    border-radius: 10px;
  }

  .welcome-panel__content {
    padding: 0.7rem 1rem 0.8rem;
  }

  .welcome-panel__logo {
    width: 120px;
    margin-bottom: 0.35rem;
  }

  .welcome-panel__headline {
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
  }

  .welcome-panel__text {
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .welcome-panel__text--lead {
    display: none;
  }

  .welcome-panel__form {
    flex-direction: row;
    margin-top: 0.55rem;
    flex-wrap: nowrap;
  }

  .welcome-panel__input {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
  }

  .welcome-panel__btn {
    flex-shrink: 0;
    width: auto;
  }

  .welcome-panel__stats {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 0.5rem;
    gap: 0.35rem;
  }

  .welcome-panel__stat {
    font-size: 0.8rem;
  }

  .welcome-panel__fine {
    font-size: 0.875rem;
    margin-top: 0.45rem;
  }

  .welcome-panel__close-bottom {
    margin-top: 0.45rem;
    min-height: 36px;
    padding: 0.45rem 0.9rem;
  }
}

/* ── Reduce motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .welcome-overlay {
    transition: opacity 150ms ease;
  }
}
