/* ==========================================================
   GIM AI V4 - CHAT-FIRST EXPERIENCE
   ========================================================== */

.chat-first-auth {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(
      circle at 50% -20%,
      rgba(66, 217, 210, .09),
      transparent 34%
    ),
    #071018;
}

.chat-first-auth::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(
      rgba(255, 255, 255, .018) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, .018) 1px,
      transparent 1px
    );
  background-size: 72px 72px;
  mask-image:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, .7),
      transparent 72%
    );
}

.chat-auth-header {
  position: relative;
  z-index: 5;
  width: 100%;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.chat-auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.chat-auth-brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.chat-auth-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-auth-brand-copy strong {
  color: #f3fafc;
  font-size: 15px;
  letter-spacing: -.01em;
}

.chat-auth-brand-copy span {
  color: #718b96;
  font-size: 10px;
}

.auth-access {
  position: relative;
}

.auth-access > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 10px 17px;
  border: 1px solid rgba(66, 217, 210, .26);
  border-radius: 999px;
  color: #031112;
  background:
    linear-gradient(
      135deg,
      #72eee8,
      #42d9d2
    );
  font-size: 13px;
  font-weight: 750;
  box-shadow:
    0 10px 30px rgba(66, 217, 210, .10);
}

.auth-access > summary::-webkit-details-marker {
  display: none;
}

.auth-access[open] > summary {
  box-shadow:
    0 12px 36px rgba(66, 217, 210, .18);
}

.auth-drawer {
  position: absolute;
  top: 51px;
  right: 0;
  width: min(420px, calc(100vw - 32px));
  padding: 25px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 22px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, .025),
      transparent
    ),
    rgba(8, 23, 32, .985);
  box-shadow:
    0 34px 100px rgba(0, 0, 0, .52);
  backdrop-filter: blur(28px);
}

.auth-drawer-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 23px;
}

.auth-drawer-head img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.auth-drawer-head .eyebrow {
  margin: 0 0 4px;
  color: #42d9d2;
  font-size: 8px;
  letter-spacing: .16em;
}

.auth-drawer-head h2 {
  margin: 0;
  color: #f3fafc;
  font-size: 22px;
  letter-spacing: -.035em;
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: #9db2bb;
  font-size: 12px;
}

.auth-form input,
.auth-form select {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 11px;
  padding: 0 13px;
  color: #f1f8fa;
  background: rgba(1, 10, 15, .62);
}

.auth-form .primary,
.auth-form .secondary {
  min-height: 45px;
}

.auth-drawer-foot {
  margin: 18px 0 0;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  color: #58717b;
  font-size: 9px;
  text-align: center;
}

.guest-chat-home {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 50px 24px 110px;
}

.guest-chat-inner {
  width: min(760px, 100%);
  text-align: center;
}

.guest-chat-logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
  margin-bottom: 27px;
  filter:
    drop-shadow(
      0 15px 28px rgba(0, 0, 0, .25)
    );
}

.guest-chat-inner h1 {
  margin: 0;
  color: #f5fafc;
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -.045em;
}

.guest-chat-subtitle {
  max-width: 570px;
  margin: 15px auto 29px;
  color: #839ba6;
  font-size: 15px;
  line-height: 1.6;
}

.guest-composer {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 13px 12px 22px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 25px;
  text-align: left;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, .026),
      transparent
    ),
    rgba(12, 29, 39, .88);
  box-shadow:
    0 22px 70px rgba(0, 0, 0, .25);
}

.guest-composer-placeholder {
  flex: 1;
  color: #667f8a;
  font-size: 15px;
}

.guest-composer-send {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  border-radius: 50%;
  color: #061315;
  background: #42d9d2;
  font-size: 22px;
  font-weight: 700;
  opacity: .55;
}

.guest-chat-access-note {
  margin: 13px 0 0;
  color: #536c76;
  font-size: 10px;
}

.chat-auth-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px;
  color: #49626c;
  font-size: 9px;
}

/* Authenticated app: make AI conversation the visual priority. */

#view-ai:not(.hidden) {
  min-height: calc(100vh - 92px);
}

#view-ai .ai-panel {
  min-height: calc(100vh - 140px);
}

#view-ai .chat-log {
  min-height: calc(100vh - 350px);
}

#view-ai .composer {
  position: sticky;
  bottom: 0;
}

/* Mobile */

@media (max-width: 760px) {
  .chat-auth-header {
    padding: 13px 15px;
  }

  .chat-auth-brand-copy span {
    display: none;
  }

  .chat-auth-brand-logo {
    width: 38px;
    height: 38px;
  }

  .auth-drawer {
    position: fixed;
    top: 72px;
    left: 15px;
    right: 15px;
    width: auto;
  }

  .guest-chat-home {
    padding:
      40px
      16px
      95px;
  }

  .guest-chat-logo {
    width: 76px;
    height: 76px;
  }

  .guest-chat-inner h1 {
    font-size: 34px;
  }

  .guest-chat-subtitle {
    font-size: 14px;
  }

  .guest-composer {
    min-height: 68px;
    border-radius: 22px;
    padding-left: 18px;
  }

  .guest-composer-send {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .chat-auth-footer {
    justify-content: center;
    padding: 0 15px;
    text-align: center;
  }

  .chat-auth-footer span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
