/**
 * Skyy auth flow — full-page signup / login visual system.
 */
.auth-flow {
  position: fixed;
  inset: 0;
  z-index: 380;
  display: grid;
  place-items: center;
  padding:
    max(20px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255, 143, 177, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(139, 92, 246, 0.06), transparent 50%),
    #06060a;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.auth-flow[hidden] {
  display: none !important;
}

.auth-flow.is-active {
  display: grid;
}

html.auth-flow-active body {
  overflow: hidden;
}

.auth-flow__card {
  width: min(100%, 420px);
  padding: clamp(24px, 5vw, 36px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(16, 16, 22, 0.92);
  box-shadow:
    0 0 0 1px rgba(255, 143, 177, 0.06) inset,
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 48px rgba(255, 143, 177, 0.04);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

.auth-flow__brand {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.auth-flow__logo {
  height: 36px;
  width: auto;
  opacity: 0.95;
}

.auth-flow__title {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 4.5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
  color: #fff;
}

.auth-flow__lead {
  margin: 0 0 22px;
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: center;
  color: rgba(255, 255, 255, 0.62);
}

.auth-flow__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.auth-flow__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.auth-flow__input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  box-sizing: border-box;
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.auth-flow__input:focus {
  outline: none;
  border-color: rgba(255, 143, 177, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 143, 177, 0.12);
}

.auth-flow__url-input {
  display: flex;
  align-items: center;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.auth-flow__url-input:focus-within {
  border-color: rgba(255, 143, 177, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 143, 177, 0.12);
}

.auth-flow__url-prefix {
  flex-shrink: 0;
  padding-left: 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}

.auth-flow__input--username {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  padding-left: 4px;
}

.auth-flow__input--username:focus {
  box-shadow: none;
}

.auth-flow__status {
  min-height: 1.2em;
  margin: -6px 0 14px;
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}

.auth-flow__status.is-success {
  color: rgba(134, 239, 172, 0.95);
}

.auth-flow__status.is-error {
  color: rgba(255, 140, 140, 0.95);
}

.auth-flow__message {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.75);
}

.auth-flow__message[hidden] {
  display: none !important;
}

.auth-flow__message.is-error {
  background: rgba(255, 80, 80, 0.1);
  color: rgba(255, 180, 180, 0.95);
}

.auth-flow__message.is-success {
  background: rgba(52, 211, 153, 0.1);
  color: rgba(167, 243, 208, 0.95);
}

.auth-flow__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  padding: 0 18px;
  border: none;
  border-radius: 12px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition:
    transform 200ms ease,
    opacity 200ms ease,
    background 200ms ease;
}

.auth-flow__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-flow__btn--primary {
  background: linear-gradient(135deg, rgba(255, 143, 177, 0.95), rgba(192, 132, 252, 0.92));
  color: #111;
  box-shadow: 0 8px 24px rgba(255, 143, 177, 0.22);
}

.auth-flow__btn--primary:not(:disabled):hover,
.auth-flow__btn--primary:not(:disabled):focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.auth-flow__btn--secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-flow__providers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.auth-flow__provider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 200ms ease,
    background 200ms ease;
}

.auth-flow__provider:not(:disabled):hover,
.auth-flow__provider:not(:disabled):focus-visible {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.auth-flow__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-flow__divider::before,
.auth-flow__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.auth-flow__claimed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 143, 177, 0.08);
  border: 1px solid rgba(255, 143, 177, 0.16);
}

.auth-flow__claimed-label {
  width: 100%;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 143, 177, 0.85);
}

.auth-flow__claimed-value {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.auth-flow__agreements {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.auth-flow__check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.auth-flow__check input {
  margin-top: 2px;
  flex-shrink: 0;
}

.auth-flow__check--optional {
  color: rgba(255, 255, 255, 0.55);
}

.auth-flow__hint {
  margin: -4px 0 14px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
}

.auth-flow__hint--legal {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.4;
}

.auth-flow__footer {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
}

.auth-flow__link {
  color: rgba(255, 143, 177, 0.95);
  text-decoration: none;
  font-weight: 600;
}

.auth-flow__link:hover {
  text-decoration: underline;
}

.auth-flow__text-btn,
.auth-flow__back {
  display: block;
  margin: 12px auto 0;
  padding: 0;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: center;
}

.auth-flow__back {
  margin: 0 0 12px;
  text-align: left;
}

.auth-flow__text-btn:hover,
.auth-flow__back:hover {
  color: rgba(255, 255, 255, 0.85);
}

.auth-flow__email-display {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  color: #fff;
  word-break: break-all;
}

@media (max-width: 480px) {
  .auth-flow__card {
    padding: 22px 18px;
    border-radius: 16px;
  }

  .auth-flow__input,
  .auth-flow__url-input,
  .auth-flow__btn,
  .auth-flow__provider {
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-flow__btn,
  .auth-flow__provider,
  .auth-flow__input,
  .auth-flow__url-input {
    transition: none;
  }
}
