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

html,
body,
#app {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Proxima Nova', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  position: relative;
  background: #1a1a2e no-repeat 52% bottom;
  background-size: cover;
  border: 4px solid rgba(255, 200, 100, 0.3);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#app img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

/* ===== Main Scene ===== */
.main-scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.main-scene.scene-hidden {
  opacity: 0;
  transform: scale(0.95);
}

.scene-center {
  position: relative;
}

/* ===== Agent Avatars ===== */
.avatars-container {
  position: fixed;
  inset: 0;
  transition: opacity 0.36s ease-out;
}

.avatars-container.avatars-hidden {
  opacity: 0;
}

.agent-avatar {
  position: absolute;
  background: none;
  border: none;
  outline: none;
  z-index: 10;
  pointer-events: auto;
  cursor: pointer;
  will-change: transform, opacity;
  transition: transform 0.48s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.36s ease-out,
    top 0.48s cubic-bezier(0.22, 0.61, 0.36, 1),
    left 0.48s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Hide non-seated agents */
.agent-avatar:not(.seated) {
  opacity: 0;
  pointer-events: none;
}

/* Disable float animations during agent transitions */
.avatars-container.transitioning .avatar-inner {
  animation: none;
}

.agent-avatar.seated {
  z-index: 30;
  opacity: 1;
  pointer-events: none;
}

.avatar-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.agent-avatar.seated .avatar-inner {
  animation: avatar-float 2.5s ease-in-out infinite;
}

@keyframes avatar-float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.avatar-circle {
  width: clamp(5.5rem, 18.9vmin, 18rem);
  height: clamp(5.5rem, 18.9vmin, 18rem);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.48s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.6));
}

.agent-avatar.seated .avatar-circle {
  width: 172vmin;
  height: 172vmin;
}

.agent-avatar.seated .avatar-name {
  display: none;
}


.avatar-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 6px;
  transition: opacity 0.3s;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.agent-avatar.seated .avatar-name {
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.1rem;
  white-space: nowrap;
  opacity: 1;
  z-index: 35;
}

/* ===== Speech Bubble ===== */
.intro-card {
  position: fixed;
  z-index: 32;
  max-width: calc(100vw - 10px);
  transition: none;
  pointer-events: none;
}

.intro-card.card-hidden {
  opacity: 0;
  pointer-events: none;
}

.intro-card-inner {
  position: relative;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 0.75rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  width: min(24vw, 20rem);
  min-width: 13rem;
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-wrap: break-word;
}


.intro-text {
  color: rgba(255, 255, 255, 0.85);
  font-size: clamp(0.9rem, 1.4vmin, 0.95rem);
  line-height: 1.55;
  margin-bottom: 0;
}

.bottom-buttons {
  position: fixed;
  bottom: clamp(1rem, 3vh, 2rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  display: flex;
  gap: clamp(0.5rem, 1.5vw, 1rem);
  opacity: 1;
}

.bottom-buttons:hover {
  opacity: 1;
}

.btn-bottom {
  padding: clamp(0.4rem, 1.5vmin, 1.1rem) clamp(0.6rem, 3vw, 2.5rem);
  border-radius: 999px;
  font-size: clamp(0.65rem, 2.5vmin, 1.25rem);
  font-weight: 600;
  cursor: pointer;
  border: none;
  color: white;
  font-family: 'Proxima Nova', sans-serif;
  white-space: nowrap;
  transition: transform 0.15s;
}

.btn-bottom:hover {
  transform: scale(1.05);
}

.btn-bottom:active {
  transform: scale(0.95);
}

.btn-contact-primary {
  background: #EEA43E;
}

/* ===== Agent Nav Arrows ===== */
.btn-nav {
  position: fixed;
  z-index: 35;
  opacity: 0;
  top: 38%;
  background: rgba(254, 249, 243, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffa314;
  font-size: clamp(2rem, 5vmin, 4rem);
  font-weight: 700;
  width: clamp(3rem, 6.5vmin, 4.5rem);
  height: clamp(3rem, 6.5vmin, 4.5rem);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s, transform 0.15s, opacity 0.4s ease-out;
  line-height: 1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.btn-nav-left {
  left: 26%;
}

.btn-nav-right {
  right: 30%;
}

.btn-nav:hover {
  background: rgba(254, 249, 243, 0.55);
  transform: scale(1.1);
}

.btn-nav:active {
  transform: scale(0.95);
}

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

/* ===== Contact Form Overlay ===== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: opacity 0.3s ease-out;
}

.overlay.overlay-hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.form-card {
  position: relative;
  width: 100%;
  max-width: 28rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  will-change: transform;
  transform: scale(0.9) translateY(40px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.overlay:not(.overlay-hidden) .form-card {
  transform: scale(1) translateY(0);
}

.btn-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.25rem;
  cursor: pointer;
  transition: color 0.2s;
  font-family: 'Proxima Nova', sans-serif;
}

.btn-close:hover {
  color: rgba(255, 255, 255, 0.8);
}

.form-title {
  color: white;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.form-subtitle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 0.875rem;
  font-family: 'Proxima Nova', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-submit {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.75rem;
  font-weight: 500;
  color: white;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  background: #4272ab;
  font-family: 'Proxima Nova', sans-serif;
  transition: transform 0.15s;
}

.btn-submit:hover {
  transform: scale(1.02);
}

.btn-submit:active {
  transform: scale(0.98);
}

.form-privacy-link {
  display: block;
  text-align: center;
  margin-top: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.7rem;
  text-decoration: none;
}

.form-privacy-link:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* ===== Confirmation ===== */
.confirmation {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(135deg, #E8F4FD, #d0e8f7);
  transition: opacity 0.8s ease-out;
}

.confirmation.confirmation-hidden {
  opacity: 0;
  pointer-events: none;
}

.confirmation-heart {
  font-size: 4.375rem;
  margin-bottom: 2rem;
  animation: pulse-heart 1.5s ease-in-out infinite;
}

@keyframes pulse-heart {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }
}

.confirmation-title {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  color: #1A1A2E;
  margin-bottom: 0.75rem;
  opacity: 0;
  transform: translateY(20px);
  animation: slide-up 0.5s ease-out 0.3s forwards;
}

.confirmation-subtitle {
  font-size: 1.125rem;
  text-align: center;
  color: rgba(26, 26, 46, 0.6);
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateY(20px);
  animation: slide-up 0.5s ease-out 0.5s forwards;
}

.confirmation-brand-logo {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  height: 2.5rem;
  width: auto;
  opacity: 0;
  animation: fade-in 0.5s ease-out 0.8s forwards;
}

.btn-back-to-agents {
  padding: 0.75rem 2rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  color: white;
  background: #4272ab;
  font-family: 'Proxima Nova', sans-serif;
  transition: transform 0.15s;
  opacity: 0;
  animation: fade-in 0.5s ease-out 0.7s forwards;
}

.btn-back-to-agents:hover {
  transform: scale(1.05);
}

.btn-back-to-agents:active {
  transform: scale(0.95);
}

@keyframes slide-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Table Overlay ===== */
.table-overlay {
  position: fixed;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  z-index: 25;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

.table-overlay.visible {
  opacity: 1;
}

.table-overlay-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% bottom;
  display: block;
}

/* ===== Page Title / Logo ===== */
.page-title {
  position: fixed;
  top: clamp(0.5rem, 2vh, 1.5rem);
  left: 48%;
  transform: translateX(-50%);
  z-index: 34;
  pointer-events: none;
}

.page-logo {
  height: clamp(10rem, 36vh, 28rem);
  width: auto;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.4));
}

/* ===== Watermark / Logo ===== */
.watermark {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 35;
  pointer-events: none;
}

.watermark-logo {
  height: 2.5rem;
  width: auto;
  opacity: 0.5;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.4));
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
  .btn-nav {
    top: 33%;
  }

  .btn-nav-left {
    left: 3%;
  }

  .btn-nav-right {
    right: 3%;
  }

  .intro-card {
    max-width: calc(100vw - 16px);
  }

  .intro-card-inner {
    width: auto;
    min-width: 0;
    max-width: calc(100vw - 24px);
    padding: 0.75rem 0.85rem;
    overflow-y: auto;
  }

  .intro-text {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .bottom-buttons {
    flex-direction: column;
    align-items: center;
    bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  }

  .btn-bottom {
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
  }

  .form-title {
    font-size: 1.15rem;
  }

  .form-group label {
    font-size: 0.9rem;
  }

  .form-group input,
  .form-group textarea {
    font-size: 1rem;
    padding: 0.7rem 0.85rem;
  }

  .btn-submit {
    font-size: 0.95rem;
    padding: 0.8rem;
  }

  .confirmation-title {
    font-size: 1.35rem;
  }

  .confirmation-subtitle {
    font-size: 1rem;
  }
}

@media (min-width: 768px) {
  .agent-avatar.seated .avatar-circle {
    width: 127vmin;
    height: 127vmin;
  }

  .confirmation-title {
    font-size: 1.875rem;
  }

  /* Push the table lower on larger screens so it's less dominant.
     Both background and overlay use the same offset so they stay aligned 1:1. */
  #app {
    background-position: 52% calc(100% + 15vh);
  }

  .table-overlay-img {
    object-position: 52% calc(100% + 15vh);
  }

  /* Scale up text and containers for larger screens */

  .intro-card-inner {
    width: min(34vw, 32rem);
    min-width: 20rem;
    padding: 1.1rem 1rem;
    border-radius: 1rem;
  }

  .intro-text {
    font-size: clamp(1rem, 2.2vmin, 1.35rem);
    line-height: 1.6;
  }

  .form-card {
    max-width: 34rem;
    padding: 2rem;
  }

  .form-title {
    font-size: 1.6rem;
  }

  .form-subtitle {
    font-size: 1rem;
  }

  .form-group label {
    font-size: 1rem;
  }

  .form-group input,
  .form-group textarea {
    font-size: 1rem;
    padding: 0.75rem 1.1rem;
  }

  .btn-submit {
    font-size: 1rem;
    padding: 0.85rem;
  }

  .btn-bottom {
    font-size: clamp(0.85rem, 2.5vmin, 1.4rem);
    padding: clamp(0.6rem, 1.5vmin, 1.2rem) clamp(1rem, 3vw, 3rem);
  }

  .confirmation-subtitle {
    font-size: 1.3rem;
  }

  .btn-back-to-agents {
    font-size: 1.1rem;
    padding: 0.85rem 2.5rem;
  }

  .watermark-logo {
    height: 3rem;
  }
}