:root {
  --playtalk-global-bg-desktop: url('/api/r2-media/backgrounds/playtalk-global-desktop.webp');
  --playtalk-global-bg-mobile: url('/api/r2-media/backgrounds/playtalk-global-mobile.webp');
  --playtalk-global-bg-image: var(--playtalk-global-bg-desktop);
}

.auth-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background: #041226 var(--playtalk-global-bg-image) center/cover fixed no-repeat;
  font-family: 'Open Sans', sans-serif;
  padding: 20px;
  overflow-x: hidden;
  position: relative;
  pointer-events: auto;
  touch-action: manipulation;
}

.auth-page,
.auth-page * {
  box-sizing: border-box;
}

@media (max-width: 800px) {
  :root {
    --playtalk-global-bg-image: var(--playtalk-global-bg-mobile);
  }

  .auth-page {
    padding: 16px;
    justify-items: center;
  }
}

.auth-card {
  width: min(420px, 95vw);
  background: rgba(1, 8, 22, 0.18);
  border: 1px solid rgba(95, 185, 255, 0.24);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34), 0 0 34px rgba(0, 92, 190, 0.18);
  backdrop-filter: blur(8px);
  padding: 26px;
  color: #ffffff;
  margin-inline: auto;
  justify-self: center;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.auth-logo {
  width: min(100%, 350px);
  max-height: 120px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto 18px;
}

@media (max-width: 800px) {
  .auth-card {
    width: min(420px, calc(100vw - 32px));
  }

  .auth-logo {
    width: min(100%, 330px);
  }
}

.auth-subtitle {
  margin: 8px 0 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.auth-switch__btn {
  border: 1px solid rgba(79, 190, 255, 0.45);
  background: linear-gradient(135deg, rgba(0, 17, 42, 0.78), rgba(0, 55, 110, 0.58));
  color: #ffffff;
  border-radius: 10px;
  padding: 10px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 0 18px rgba(0, 153, 255, 0.12), 0 0 18px rgba(0, 102, 255, 0.1);
  pointer-events: auto;
  touch-action: manipulation;
}

.auth-switch__btn.is-active {
  background: linear-gradient(135deg, #001a3d 0%, #004fb4 48%, #00a3ff 100%);
  color: #ffffff;
  border-color: rgba(115, 218, 255, 0.9);
  box-shadow: 0 0 22px rgba(0, 166, 255, 0.5), inset 0 0 16px rgba(255, 255, 255, 0.14);
}

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

.auth-form label {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.9);
}

.auth-form input {
  border-radius: 10px;
  border: 1px solid rgba(93, 190, 255, 0.38);
  background: linear-gradient(135deg, rgba(1, 5, 14, 0.96), rgba(2, 21, 54, 0.94) 58%, rgba(0, 42, 94, 0.88));
  color: #ffffff;
  padding: 11px;
  font-size: 16px;
  line-height: 1.2;
  -webkit-user-select: text;
  user-select: text;
  pointer-events: auto;
  touch-action: auto;
  -webkit-appearance: none;
  appearance: none;
}

.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus,
.auth-form input:-webkit-autofill:active {
  -webkit-text-fill-color: #ffffff;
  caret-color: #ffffff;
  -webkit-box-shadow: 0 0 0 1000px rgba(1, 5, 14, 0.96) inset;
  box-shadow: 0 0 0 1000px rgba(1, 5, 14, 0.96) inset;
  transition: background-color 9999s ease-out 0s, color 9999s ease-out 0s;
}

.auth-form input:-webkit-autofill {
  border-color: rgba(93, 190, 255, 0.38);
}

.auth-form input:focus {
  outline: 2px solid rgba(66, 190, 255, 0.3);
  border-color: rgba(111, 220, 255, 0.9);
  box-shadow: 0 0 20px rgba(0, 142, 255, 0.28);
}

.auth-form input::placeholder {
  color: rgba(255, 255, 255, 0.54);
}

#auth-submit {
  margin-top: 8px;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, #001a3d 0%, #004fb4 48%, #00a3ff 100%);
  color: #ffffff;
  cursor: pointer;
  border: 1px solid rgba(126, 222, 255, 0.75);
  box-shadow: 0 0 24px rgba(0, 153, 255, 0.48), inset 0 0 18px rgba(255, 255, 255, 0.12);
  pointer-events: auto;
  touch-action: manipulation;
}

#auth-submit:disabled,
.btn-google:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 14px 0;
  color: #6b7280;
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.auth-divider span {
  padding: 0 10px;
}

.btn-google {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
}

.auth-message {
  min-height: 24px;
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.9rem;
}

.auth-message.is-error {
  color: #ffb4b4;
}

.auth-message.is-success {
  color: #9fffe0;
}
