/* Web frosted-glass approximation: translucent layers, blurred refraction, and a solid fallback. */
.xy-auth-view {
  --xy-auth-background: rgb(248 250 250);
  --xy-auth-surface: rgb(249 253 252 / 0.48);
  --xy-auth-surface-deep: rgb(225 237 236 / 0.56);
  --xy-auth-ink: rgb(21 42 49 / 0.94);
  --xy-auth-copy: rgb(35 62 69 / 0.74);
  --xy-auth-line: rgb(255 255 255 / 0.52);
  --xy-auth-line-bright: rgb(255 255 255 / 0.76);
  position: relative;
  isolation: isolate;
  display: grid;
  min-block-size: 100dvh;
  place-items: center;
  overflow: clip;
  padding: var(--ui-space-6);
  background: var(--xy-auth-background);
  color: var(--xy-auth-ink);
  color-scheme: light;
}

.xy-auth-view::after,
.xy-auth-view__background {
  position: absolute;
  pointer-events: none;
}

.xy-auth-view__background {
  z-index: -3;
  inset: calc(0px - var(--ui-space-4));
  inline-size: calc(100% + (var(--ui-space-4) * 2));
  block-size: calc(100% + (var(--ui-space-4) * 2));
  object-fit: cover;
  object-position: 84% 68%;
  filter: blur(16px) saturate(0.78) brightness(1.04);
  opacity: 0.96;
  transform: scale(1.32);
  -webkit-mask-image: radial-gradient(
    ellipse at 50% 50%,
    #000 34%,
    rgb(0 0 0 / 0.84) 59%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse at 50% 50%,
    #000 34%,
    rgb(0 0 0 / 0.84) 59%,
    transparent 100%
  );
}

.xy-auth-view::after {
  z-index: -2;
  inset: calc(0px - var(--ui-space-4));
  content: "";
}

.xy-auth-view::after {
  background:
    radial-gradient(
      ellipse at 50% 48%,
      rgb(248 250 250 / 0.02) 0 21%,
      rgb(248 250 250 / 0.28) 54%,
      rgb(248 250 250 / 0.99) 100%
    ),
    linear-gradient(
      90deg,
      rgb(248 250 250 / 0.96),
      transparent 28%,
      transparent 72%,
      rgb(248 250 250 / 0.96)
    );
  backdrop-filter: blur(14px) saturate(0.9);
  -webkit-backdrop-filter: blur(14px) saturate(0.9);
}

.xy-auth-view__card {
  position: relative;
  display: grid;
  inline-size: min(100%, 23rem);
  gap: var(--ui-space-5);
  padding: clamp(var(--ui-space-5), 5vw, var(--ui-space-8));
  border: var(--ui-border-width) solid var(--xy-auth-line);
  z-index: 1;
  border-radius: clamp(1.5rem, 3vw, 2rem);
  background:
    linear-gradient(145deg, rgb(255 255 255 / 0.68), transparent 42%),
    linear-gradient(180deg, var(--xy-auth-surface), var(--xy-auth-surface-deep));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.72),
    inset 0 -1.5rem 2.25rem rgb(153 188 189 / 0.14),
    0 1.5rem 5rem rgb(70 100 112 / 0.18),
    0 0 4.5rem rgb(216 241 242 / 0.5);
  backdrop-filter: blur(30px) saturate(115%) contrast(1.02);
  -webkit-backdrop-filter: blur(30px) saturate(115%) contrast(1.02);
  transition:
    border-color 220ms ease,
    box-shadow 320ms ease;
}

.xy-auth-view__card::before,
.xy-auth-view__card::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.xy-auth-view__card::before {
  inset: -0.7rem;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 8%, rgb(255 255 255 / 0.76), transparent 38%);
  filter: blur(22px);
  opacity: 0.66;
}

.xy-auth-view__card::after {
  border: var(--ui-border-width) solid rgb(255 255 255 / 0.08);
  box-shadow: inset 0 0 2rem rgb(221 244 245 / 0.04);
}

.xy-auth-view__header,
.xy-auth-view__panel-content,
.xy-auth-view__form,
.xy-auth-view__field-set,
.xy-auth-view__field,
.xy-auth-view__control-wrap {
  display: grid;
  min-inline-size: 0;
}

.xy-auth-view__header {
  justify-items: center;
  gap: var(--ui-space-1);
  text-align: center;
}

.xy-auth-view__title,
.xy-auth-view__subtitle,
.xy-auth-view__field-label,
.xy-auth-view__form-note,
.xy-auth-view__utility-action {
  margin: 0;
}

.xy-auth-view__title {
  color: var(--xy-auth-ink);
  font-family: var(--ui-font-sans);
  font-size: 1.25rem;
  font-weight: var(--ui-font-weight-strong);
  letter-spacing: -0.025em;
  line-height: 1.35;
}

.xy-auth-view__subtitle,
.xy-auth-view__form-note {
  color: var(--xy-auth-copy);
  font-size: var(--ui-font-size-label);
  line-height: 1.65;
}

.xy-auth-view__mode-tabs,
.xy-auth-view__method-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ui-space-1);
}

.xy-auth-view__mode-tabs {
  padding: var(--ui-space-1);
  border: var(--ui-border-width) solid rgb(255 255 255 / 0.36);
  border-radius: 1rem;
  background: rgb(255 255 255 / 0.18);
}

.xy-auth-view__mode-tab,
.xy-auth-view__method {
  min-block-size: 2.25rem;
  border: var(--ui-border-width) solid transparent;
  border-radius: 0.85rem;
  background: transparent;
  color: rgb(25 53 60 / 0.7);
  cursor: pointer;
  font: inherit;
  font-size: var(--ui-font-size-label);
  font-weight: var(--ui-font-weight-emphasis);
  line-height: 1;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 240ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.xy-auth-view__mode-tab[aria-selected="true"],
.xy-auth-view__method[aria-pressed="true"] {
  border-color: rgb(255 255 255 / 0.58);
  background: rgb(255 255 255 / 0.48);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.64);
  color: var(--xy-auth-ink);
}

.xy-auth-view__card-panel,
.xy-auth-view__panel-content,
.xy-auth-view__form,
.xy-auth-view__field-set {
  gap: var(--ui-space-3);
}

.xy-auth-view__field-set {
  margin: 0;
  padding: 0;
  border: 0;
}

.xy-auth-view__field-set:disabled {
  opacity: 1;
}

.xy-auth-view__field {
  gap: var(--ui-space-1);
}

.xy-auth-view__field-label {
  color: rgb(22 52 59 / 0.78);
  font-size: var(--ui-font-size-label);
  font-weight: var(--ui-font-weight-emphasis);
  line-height: 1.5;
}

.xy-auth-view__control {
  inline-size: 100%;
  min-block-size: 2.5rem;
  padding-inline: var(--ui-space-3);
  border: var(--ui-border-width) solid rgb(255 255 255 / 0.4);
  border-radius: 0.9rem;
  outline: 0;
  background: rgb(255 255 255 / 0.3);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.48);
  color: var(--xy-auth-ink);
  font: inherit;
  font-size: var(--ui-font-size-small);
}

.xy-auth-view__control-wrap {
  position: relative;
}

.xy-auth-view__control-wrap .xy-auth-view__control {
  padding-inline-end: 7rem;
}

.xy-auth-view__code-send {
  position: absolute;
  inset-block: 0.3125rem;
  inset-inline-end: 0.3125rem;
  display: inline-flex;
  min-block-size: 1.875rem;
  align-items: center;
  gap: 0.25rem;
  padding-inline: 0.5rem;
  border: var(--ui-border-width) solid rgb(255 255 255 / 0.56);
  border-radius: 0.625rem;
  background: rgb(255 255 255 / 0.54);
  color: rgb(31 70 78 / 0.76);
  cursor: not-allowed;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: var(--ui-font-weight-emphasis);
  line-height: 1;
}

.xy-auth-view__code-send:disabled {
  opacity: 0.74;
}

.xy-auth-view__code-send-icon {
  font-size: 0.75rem;
  line-height: 1;
}

.xy-auth-view__control:disabled {
  cursor: not-allowed;
  opacity: 1;
}

.xy-auth-view__control::placeholder {
  color: rgb(40 70 78 / 0.5);
  opacity: 1;
}

.xy-auth-view__action {
  min-block-size: 2.5rem;
  margin-block-start: var(--ui-space-1);
  border: 0;
  border-radius: 0.9rem;
  background: rgb(255 255 255 / 0.86);
  color: rgb(10 18 19);
  cursor: not-allowed;
  font: inherit;
  font-size: var(--ui-font-size-small);
  font-weight: var(--ui-font-weight-strong);
  line-height: 1;
}

.xy-auth-view__action:disabled {
  opacity: 0.9;
}

.xy-auth-view__form-note {
  min-block-size: 1.25rem;
  text-align: center;
}

.xy-auth-view__utility-action {
  justify-self: center;
  min-block-size: 1.5rem;
  margin: calc(var(--ui-space-1) * -1) 0;
  padding: 0;
  border: 0;
  border-bottom: var(--ui-border-width) solid transparent;
  background: transparent;
  color: rgb(31 70 78 / 0.74);
  cursor: pointer;
  font: inherit;
  font-size: var(--ui-font-size-label);
  line-height: 1.5;
  transition:
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.xy-auth-view__mode-tab:focus-visible,
.xy-auth-view__method:focus-visible,
.xy-auth-view__utility-action:focus-visible {
  outline: var(--ui-focus-outline-width) solid rgb(29 83 91 / 0.82);
  outline-offset: var(--ui-focus-outline-offset);
}

@media (hover: hover) and (pointer: fine) {
  .xy-auth-view__card:hover {
    border-color: rgb(255 255 255 / 0.76);
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / 0.86),
      inset 0 -1.5rem 2.25rem rgb(153 188 189 / 0.1),
      0 1.5rem 5rem rgb(70 100 112 / 0.14),
      0 0 5.25rem rgb(219 249 250 / 0.72);
  }

  .xy-auth-view__mode-tab:hover,
  .xy-auth-view__method:hover,
  .xy-auth-view__utility-action:hover {
    border-color: rgb(255 255 255 / 0.66);
    background: rgb(255 255 255 / 0.54);
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / 0.72),
      0 0.5rem 1.25rem rgb(77 112 120 / 0.12);
    color: var(--xy-auth-ink);
    transform: translateY(-1px);
  }

  .xy-auth-view__utility-action:hover {
    border-color: rgb(31 70 78 / 0.42);
    background: transparent;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .xy-auth-view__card {
    animation: xy-auth-card-breathe 9s ease-in-out infinite alternate;
  }
}

@keyframes xy-auth-card-breathe {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(0, -0.25rem, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .xy-auth-view__card,
  .xy-auth-view__mode-tab,
  .xy-auth-view__method,
  .xy-auth-view__utility-action {
    transition-duration: 0ms;
  }

  .xy-auth-view__card {
    animation: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .xy-auth-view__card {
    background: rgb(240 247 245 / 0.98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (max-width: 30rem) {
  .xy-auth-view {
    padding: var(--ui-space-4);
  }

  .xy-auth-view__card {
    padding: var(--ui-space-5);
  }
}

@media (max-width: 47.999rem) {
  .xy-auth-view {
    min-block-size: calc(100dvh - var(--ui-size-top-bar-compact));
  }
}

@media (min-width: 48rem) {
  .xy-auth-view {
    padding-block-start: calc(var(--ui-size-top-bar) + var(--ui-space-6));
  }
}
