/* Albi Mall portal */
:root {
  --red: #e31e24;
  --red-hot: #ff2d35;
  --red-soft: rgba(227, 30, 36, 0.55);
  --bg: #060304;
  --text: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.82);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --content-max: 26rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

.page {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding:
    max(1.1rem, env(safe-area-inset-top))
    max(1.35rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom))
    max(1.35rem, env(safe-area-inset-left));
}

.page__bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  will-change: transform;
}

.orb--1 {
  width: min(72vw, 320px);
  height: min(72vw, 320px);
  top: -12%;
  left: -18%;
  background: rgba(227, 30, 36, 0.38);
}

.orb--2 {
  width: min(55vw, 260px);
  height: min(55vw, 260px);
  bottom: 8%;
  right: -22%;
  background: rgba(180, 20, 28, 0.28);
}

.orb--3 {
  width: 140px;
  height: 140px;
  top: 42%;
  left: 50%;
  margin-left: -70px;
  background: rgba(255, 45, 53, 0.12);
  filter: blur(48px);
}

.brand {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.15rem 0 0.5rem;
  overflow: visible;
}

.brand__logo {
  width: 56px;
  height: auto;
  display: block;
  transform-origin: center center;
  will-change: transform;
}

.shell {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1.5rem 0;
}

.flow {
  width: 100%;
}

.flow__head {
  width: 100%;
  text-align: inherit;
}

.flow__title {
  margin: 0 0 0.65rem;
  font-size: clamp(2rem, 8vw, 2.65rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--red-hot);
  text-transform: uppercase;
  transition: letter-spacing 0.3s ease;
}

.flow__title .word {
  display: inline-block;
  overflow: hidden;
}

.flow__title .word + .word {
  margin-left: 0.12em;
}

.flow__title .char {
  display: inline-block;
  will-change: transform, opacity;
}

.flow__lead {
  margin: 0 0 2rem;
  max-width: 22rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-soft);
  font-weight: 500;
}

.flow__lead:empty,
.flow__lead[hidden] {
  display: none;
}

.panels {
  position: relative;
}

.panel {
  display: none;
}

.panel--active {
  display: block;
}

.panel--session {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.panel--session.panel--active {
  display: flex;
}

.session-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
}

.session-visual[data-state="success"] .connect-ring__arc {
  stroke: var(--red-hot);
  opacity: 0.35;
}

.session-visual[data-state="success"] .connect-ring__arc--inner,
.session-visual[data-state="fail"] .connect-ring__arc--inner {
  opacity: 0.2;
}

.session-visual[data-state="fail"] .connect-ring__arc {
  stroke: #ff6b6b;
}

.session-visual[data-state="fail"] .connect-ring__core {
  background: radial-gradient(circle, rgba(255, 80, 80, 0.35) 0%, transparent 70%);
}

.session-visual[data-state="success"] .session-dots,
.session-visual[data-state="success"] .connect-ring--outer,
.session-visual[data-state="success"] .connect-ring--inner,
.session-visual[data-state="fail"] .session-dots {
  opacity: 0.08;
  transition: opacity 0.4s ease;
}

.session-visual[data-state="success"] .connect-ring__core,
.session-visual[data-state="fail"] .connect-ring__core {
  opacity: 0.2;
}

.session-visual[data-state="connecting"] .session-glow,
.session-visual[data-state="fail"] .session-glow {
  opacity: 0;
}

.connect-ring-wrap--large {
  width: min(calc(100vw - 2.7rem), 78vmin);
  height: min(calc(100vw - 2.7rem), 78vmin);
}

.page--immersive .connect-ring-wrap--large {
  width: calc(100vw - max(2.7rem, env(safe-area-inset-left) + env(safe-area-inset-right) + 0.5rem));
  height: calc(100vw - max(2.7rem, env(safe-area-inset-left) + env(safe-area-inset-right) + 0.5rem));
  max-width: calc(100vw - 2.7rem);
  max-height: min(calc(100vw - 2.7rem), 62dvh);
  margin-inline: auto;
}

.page--immersive .session-mark {
  font-size: clamp(2.5rem, 28vw, 5.5rem);
}

.session-glow {
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 45, 53, 0.45) 0%, rgba(255, 45, 53, 0.12) 45%, transparent 72%);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.session-visual[data-state="success"] .session-glow {
  opacity: 1;
  animation: session-halo 2.4s ease-in-out infinite;
}

@keyframes session-halo {
  0%,
  100% {
    transform: scale(0.95);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.session-mark {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2.75rem, 20vmin, 5rem);
  font-weight: 300;
  line-height: 1;
  color: #fff;
  pointer-events: none;
}

.session-mark[hidden] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.session-mark--success {
  color: #fff;
  filter: drop-shadow(0 0 24px rgba(255, 45, 53, 0.9)) drop-shadow(0 0 60px rgba(255, 45, 53, 0.55));
}

.session-mark--fail {
  color: #ff9a9a;
  font-weight: 400;
  filter: drop-shadow(0 0 20px rgba(255, 80, 80, 0.75));
}

.session-hint {
  margin: 1.25rem auto 0;
  max-width: 22rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-soft);
}

.session-hint[hidden] {
  display: none;
}

.page--immersive .brand {
  position: relative;
  justify-content: flex-start;
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
  padding-bottom: 0;
  flex-shrink: 0;
}

.page--immersive .brand.brand--centered {
  justify-content: center;
}

.page--immersive .brand.brand--centered .lang-switch {
  display: none !important;
}

.page--immersive .brand.brand--centered .brand__logo {
  margin-inline: auto;
}

.page--immersive .lang-switch {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
  opacity: 0 !important;
}

.page--immersive .brand__logo {
  width: 56px;
  max-width: 56px;
}

.page--immersive .shell {
  justify-content: flex-start;
  flex: 1;
  padding: 0 0 0.75rem;
  max-width: 100%;
  width: 100%;
}

.page--immersive .flow {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  min-height: 0;
}

.page--immersive .panels {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding-top: 0.25rem;
}

.page--immersive .panel--session.panel--active {
  flex: 1;
  width: 100%;
}

.page--immersive .session-visual {
  width: 100%;
}

.page--immersive .page__foot .btn--connect {
  display: none;
}

.page--immersive.page--success .page__foot .btn--close,
.page--immersive.page--fail .page__foot .btn--connect {
  display: block !important;
  pointer-events: auto;
}

.page--immersive.page--connecting .page__foot .btn {
  display: none !important;
}

.field {
  margin-bottom: 1.75rem;
}

.field input {
  width: 100%;
  padding: 0.75rem 0;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 0;
  transition: border-color 0.2s;
}

.field input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.field input:focus {
  outline: none;
  border-bottom-color: var(--red-hot);
}

.consent {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 0;
}

.consent input[type="checkbox"] {
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.1rem 0 0;
  accent-color: var(--red-hot);
  cursor: pointer;
}

.consent__label {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-soft);
  cursor: pointer;
}

.page__foot {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: 100%;
  max-width: var(--content-max);
  margin: auto auto 0;
  padding-top: 0.5rem;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  overflow: visible;
}

.btn {
  display: block;
  width: 100%;
  padding: 1.05rem 1.25rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: var(--red);
  border: 2px solid var(--red);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.btn:hover:not(:disabled) {
  background: var(--red-hot);
  border-color: var(--red-hot);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  color: rgba(255, 255, 255, 0.45);
  background: transparent;
  border-color: rgba(227, 30, 36, 0.45);
  cursor: not-allowed;
}

.btn[hidden] {
  display: none !important;
}

.msg {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #ff9a9e;
  display: none;
}

.msg--show {
  display: block;
}

.page--immersive .flow__head {
  text-align: center;
  margin-top: clamp(2.5rem, 14vh, 6rem);
  margin-bottom: clamp(0.75rem, 3vh, 1.25rem);
  flex-shrink: 0;
}

.page--immersive .flow__title {
  margin: 0;
  font-size: clamp(1.35rem, 5.5vw, 2rem);
  font-weight: 300;
  letter-spacing: 0.14em;
}

.page--immersive.page--success .flow__title {
  color: var(--red-hot);
  font-weight: 200;
  letter-spacing: 0.22em;
  text-shadow:
    0 0 18px rgba(255, 45, 53, 0.85),
    0 0 48px rgba(255, 45, 53, 0.5),
    0 0 90px rgba(255, 45, 53, 0.25);
  animation: title-glow 2.5s ease-in-out infinite;
}

.page--immersive.page--fail .flow__title {
  color: #ff7a7a;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-shadow: 0 0 24px rgba(255, 80, 80, 0.55);
}

.page--immersive.page--connecting .flow__title {
  font-weight: 300;
  letter-spacing: 0.12em;
  opacity: 0.92;
}

@keyframes title-glow {
  0%,
  100% {
    text-shadow:
      0 0 18px rgba(255, 45, 53, 0.75),
      0 0 48px rgba(255, 45, 53, 0.4),
      0 0 80px rgba(255, 45, 53, 0.2);
  }
  50% {
    text-shadow:
      0 0 28px rgba(255, 45, 53, 1),
      0 0 64px rgba(255, 45, 53, 0.65),
      0 0 110px rgba(255, 45, 53, 0.35);
  }
}

.connect-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

.connect-ring-wrap {
  position: relative;
  width: 148px;
  height: 148px;
  margin: 0 auto;
}

.connect-ring {
  width: 100%;
  height: 100%;
  display: block;
}

.connect-ring__track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1.5;
}

.connect-ring__arc {
  fill: none;
  stroke: var(--red-hot);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.connect-ring__arc--inner {
  stroke: rgba(255, 45, 53, 0.45);
  stroke-width: 1.5;
}

.connect-ring__core {
  position: absolute;
  inset: 38%;
  z-index: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 45, 53, 0.35) 0%, transparent 70%);
}

.connect-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.32em;
  color: var(--text);
}

.connect-dots {
  display: flex;
  gap: 0.35rem;
  margin-top: -0.5rem;
}

.connect-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red-hot);
  opacity: 0.35;
}

.session-dots {
  margin-top: -0.25rem;
}

.lang-switch {
  position: relative;
  flex-shrink: 0;
  margin-left: auto;
}

.lang-switch__btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
}

.lang-switch__value {
  color: var(--text);
}

.lang-switch__chev {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid rgba(255, 255, 255, 0.55);
  border-bottom: 2px solid rgba(255, 255, 255, 0.55);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s;
}

.lang-switch--open .lang-switch__chev {
  transform: rotate(-135deg) translateY(2px);
}

.lang-switch__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 20;
  min-width: 9.5rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: #12080a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.lang-switch__option {
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.lang-switch__option:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.lang-switch__option--active {
  color: var(--red-hot);
  background: rgba(227, 30, 36, 0.12);
}

.footer {
  position: relative;
  z-index: 1;
  margin-top: 0.75rem;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.28);
  text-align: center;
}

.hotspot-form {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.connect-ring-wrap .connect-ring--outer,
.connect-ring-wrap .connect-ring--inner {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.connect-ring-wrap .connect-ring--inner {
  transform: scale(0.92);
}

/* Tablet — centered layout */
@media (min-width: 640px) {
  :root {
    --content-max: 32rem;
  }

  .page {
    align-items: center;
    padding-left: max(2rem, env(safe-area-inset-left));
    padding-right: max(2rem, env(safe-area-inset-right));
  }

  .flow__head,
  .flow__title,
  .flow__lead,
  .msg,
  .field input {
    text-align: center;
  }

  .flow__lead {
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
    font-size: 1rem;
  }

  .flow__title {
    font-size: clamp(2.5rem, 5vw, 3.25rem);
  }

  .consent {
    max-width: 30rem;
    margin-inline: auto;
  }

  .consent__label {
    text-align: left;
  }

  .field input {
    font-size: 1.2rem;
  }

  .brand__logo {
    width: 64px;
  }

  .btn {
    max-width: 22rem;
    margin-inline: auto;
  }
}

/* Desktop — wider column, larger session visuals */
@media (min-width: 900px) {
  :root {
    --content-max: 36rem;
  }

  .page {
    padding-top: max(1.75rem, env(safe-area-inset-top));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }

  .brand {
    max-width: 40rem;
    padding-bottom: 0.75rem;
  }

  .shell {
    max-width: 40rem;
    padding: 2rem 0;
  }

  .page__foot {
    max-width: 40rem;
  }

  .flow__lead {
    max-width: 32rem;
    font-size: 1.05rem;
    line-height: 1.55;
  }

  .flow__title {
    font-size: 3.5rem;
    margin-bottom: 0.85rem;
  }

  .consent {
    max-width: 34rem;
    gap: 1rem;
  }

  .consent__label {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  .field {
    margin-bottom: 2rem;
  }

  .field input {
    font-size: 1.25rem;
    padding: 0.85rem 0;
  }

  .btn {
    max-width: 24rem;
    padding: 1.15rem 1.5rem;
    font-size: 0.85rem;
  }

  .brand__logo {
    width: 72px;
  }

  .connect-ring-wrap--large {
    width: min(320px, 42vmin);
    height: min(320px, 42vmin);
  }

  .page--immersive .connect-ring-wrap--large {
    width: min(380px, 44vmin);
    height: min(380px, 44vmin);
    max-width: min(380px, 44vmin);
    max-height: min(380px, 50dvh);
  }

  .session-hint {
    max-width: 26rem;
    font-size: 1rem;
  }

  .orb--1 {
    width: min(50vw, 480px);
    height: min(50vw, 480px);
  }

  .orb--2 {
    width: min(40vw, 380px);
    height: min(40vw, 380px);
  }

  .orb--3 {
    width: 220px;
    height: 220px;
    margin-left: -110px;
  }

  .page--immersive .brand__logo {
    width: 56px;
    max-width: 56px;
  }

  .page--immersive .flow__title {
    font-size: clamp(2rem, 3.5vw, 2.75rem);
  }
}

@media (min-width: 1200px) {
  :root {
    --content-max: 40rem;
  }

  .flow__title {
    font-size: 3.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb {
    animation: none !important;
  }

  .page--immersive.page--success .flow__title,
  .session-visual[data-state="success"] .session-glow {
    animation: none !important;
  }
}
