/* Login, forgot and reset password with the Mate (fox mascot) as the face of the product.
   Desktop: graphite stage with the Mate on the left, form on the right.
   Phone: the Mate greets above the form. Neutral base, orange only on the main action. */

body.auth-mate {
  margin: 0;
  background: #f7f8fa;
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body.auth-mate .login-container {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: stretch;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  background: #f7f8fa;
}

body.auth-mate .login-box {
  align-self: center;
  justify-self: center;
  width: calc(100% - 48px);
  max-width: 400px;
  margin: 48px 0;
  padding: 32px 28px 24px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

/* the old small waving Mate on the box is replaced by the stage */
body.auth-mate .login-mate {
  display: none;
}

body.auth-mate .login-header .logo-image {
  height: 44px;
  margin-bottom: 18px;
}

body.auth-mate .login-header h1 {
  margin: 0;
  color: #221e1a;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

body.auth-mate .login-header p {
  margin: 6px 0 0;
  color: #667085;
}

/* ───────── the stage ───────── */

.auth-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  min-height: 100%;
  padding: 56px clamp(32px, 5vw, 72px);
  overflow: hidden;
  background-color: #221e1a;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  color: #fff;
}

.auth-stage__brand {
  position: absolute;
  top: 28px;
  left: clamp(32px, 5vw, 72px);
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.auth-stage__brand img {
  height: 26px;
  width: auto;
}

.auth-stage__scene {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 0;
}

.auth-stage__mate {
  position: relative;
  z-index: 1;
  flex: none;
  height: clamp(280px, 52vh, 520px);
  width: auto;
  filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.35));
  transform-origin: 50% 100%;
  animation: auth-mate-in 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.15) 0.1s both;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.auth-stage__mate.is-hop {
  animation: auth-mate-hop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

/* the speech bubble next to his head */
.auth-bubble {
  position: relative;
  align-self: flex-start;
  max-width: 300px;
  margin: clamp(16px, 6vh, 64px) 0 0 -12px;
  padding: 14px 16px;
  border-radius: 18px 18px 18px 6px;
  background: #fff;
  color: #221e1a;
  font-size: 15px;
  line-height: 1.4;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

.auth-bubble.is-on {
  opacity: 1;
  transform: none;
}

.auth-bubble__t {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.auth-bubble__t img {
  flex: none;
  width: 30px;
  height: 30px;
  margin: -4px 0 -4px -2px;
}

.auth-bubble b {
  display: block;
  font-size: 16px;
  font-weight: 650;
}

.auth-bubble::before {
  content: "";
  position: absolute;
  left: -7px;
  bottom: 14px;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #fff;
  transform: rotate(45deg);
}

.auth-bubble.is-sorry {
  box-shadow: 0 0 0 2px #e7792c, 0 12px 30px rgba(0, 0, 0, 0.25);
}

.auth-stage__copy h2 {
  margin: 0;
  max-width: 520px;
  color: #fff;
  font-size: clamp(26px, 2.6vw, 38px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.auth-stage__copy p {
  margin: 12px 0 0;
  max-width: 460px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 15px;
  line-height: 1.5;
}

.auth-stage__copy kbd {
  padding: 1px 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  font: 600 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #fff;
}

@keyframes auth-mate-in {
  0% { opacity: 0; transform: translateY(30px) scale(0.96); }
  100% { opacity: 1; transform: none; }
}

@keyframes auth-mate-hop {
  0% { transform: none; }
  40% { transform: translateY(-14px) rotate(-1.5deg); }
  100% { transform: none; }
}

/* ───────── phone and narrow windows ───────── */

@media (max-width: 960px) {
  body.auth-mate .login-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .auth-stage {
    min-height: 0;
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
    padding: 64px 16px 0;
  }

  .auth-stage__brand {
    top: 18px;
    left: 16px;
  }

  .auth-stage__copy {
    display: none;
  }

  .auth-stage__scene {
    align-items: center;
  }

  .auth-stage__mate {
    height: 180px;
    margin-bottom: -6px;
  }

  .auth-bubble {
    max-width: 210px;
    margin: 0 0 0 -6px;
    padding: 12px 14px;
    font-size: 14px;
  }

  .auth-bubble b {
    font-size: 15px;
  }

  body.auth-mate .login-box {
    align-self: start;
    margin: 20px 0 32px;
    width: calc(100% - 32px);
    padding: 24px 20px 20px;
  }

  body.auth-mate .login-header .logo-image {
    display: none;
  }
}

@media (max-width: 960px) and (max-height: 640px) {
  .auth-stage__mate {
    height: 120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-stage__mate,
  .auth-stage__mate.is-hop,
  .auth-bubble {
    animation: none !important;
    transition: none !important;
  }
}
