.auth-screen {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 28px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  padding: 48px 16px;
  background-color: var(--rail-1);
  background-image: linear-gradient(180deg, var(--rail-1) 0%, var(--rail-mid) 55%, var(--rail-2) 100%);
}
.auth-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
  pointer-events: none;
}
.auth-screen::after {
  content: "";
  position: absolute;
  inset: -10%;
  z-index: -2;
  background-image:
    radial-gradient(38vmax 38vmax at 88% 6%, rgba(22, 202, 136, .20), transparent 70%),
    radial-gradient(42vmax 42vmax at 10% 96%, rgba(12, 122, 233, .14), transparent 70%);
  animation: glow-drift 14s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes glow-drift { to { transform: translate3d(-2%, 3%, 0); } }
.auth-logo { width: 188px; height: auto; }
.auth-brand .auth-logo { width: 200px; filter: drop-shadow(0 6px 18px rgba(8, 30, 22, .35)); }

.auth-main { display: grid; gap: 16px; width: 100%; max-width: 440px; }
.auth-card {
  display: grid;
  gap: 24px;
  padding: 40px 36px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 20px;
  background: var(--white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 6px 16px rgba(8, 30, 22, .18), 0 28px 64px rgba(8, 30, 22, .34);
  animation: rise-in 280ms var(--ease);
}
.auth-card h1 { font-size: 24px; }
.auth-card .input, .auth-card .button-block { height: 46px; }
.auth-card .button-primary .icon { transition: transform var(--speed) var(--ease); }
.auth-card .button-primary:hover .icon { transform: translateX(3px); }
.auth-card-header { display: grid; gap: 6px; }
.auth-card-header .chip { justify-self: start; }
.auth-footer { text-align: center; }
.auth-screen .auth-footer, .auth-screen .auth-footer.muted { color: var(--mist); }
.auth-screen .auth-footer a { color: var(--white); }
.auth-legal { color: var(--mist); font-size: 12px; letter-spacing: .02em; text-align: center; opacity: .8; }

.auth-status {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 10px;
  border-radius: 16px;
  background: var(--tile);
  color: var(--primary);
}
.auth-status .icon { width: 26px; height: 26px; }
.auth-status-danger { background: var(--danger-soft); color: var(--danger-text); }
.auth-status-warn { background: var(--warn-soft); color: var(--gold-text); }

.input-icon { position: relative; }
.input-icon > .icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
  transition: color var(--speed) var(--ease);
}
.input-icon:focus-within > .icon { color: var(--accent); }
.input-icon > .input { padding-left: 42px; }

.email-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
}
.email-pill-text { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.email-pill a {
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--speed) var(--ease);
}
.email-pill a:hover { background: var(--white); }

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  background: linear-gradient(180deg, var(--rail-1), var(--rail-2));
  color: var(--white);
}
.auth-topbar .auth-logo { width: 120px; }
.auth-topbar .menu > summary { color: var(--white); }
.auth-topbar .menu > summary:hover { background: rgba(255, 255, 255, .10); }
.auth-topbar .avatar { background: rgba(255, 255, 255, .18); color: var(--white); }
.auth-page { max-width: 1120px; margin: 0 auto; padding: 40px 24px 56px; display: grid; gap: 28px; }

.apps-head { display: grid; justify-items: center; gap: 6px; text-align: center; }
.apps-head h1 { font-size: 28px; }
.apps-hello { color: var(--primary-deep); font-weight: 600; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 256px)); justify-content: center; gap: 16px; }

.button-provider {
  height: 44px;
  gap: 12px;
  background: var(--white);
  color: var(--ink);
  border-color: var(--border-strong);
  box-shadow: 0 1px 2px rgba(16, 40, 30, .05);
}
.button-provider:hover { background: var(--panel); color: var(--ink); border-color: var(--border-hover); }

.steps { display: grid; gap: 6px; margin: 0; padding-left: 20px; }
.qr { display: grid; place-items: center; }
.qr-code { width: 180px; height: 180px; }
.code-input { font-family: var(--mono); font-size: 20px; letter-spacing: .2em; text-align: center; }
.code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 15px;
  list-style: none;
  text-align: center;
}

@media (max-width: 599px) {
  .auth-screen { align-content: start; gap: 24px; padding: 36px 16px 28px; }
  .auth-brand .auth-logo { width: 168px; }
  .auth-card { padding: 30px 22px; border-radius: 18px; }
  .auth-topbar { padding: 0 16px; }
  .auth-page { padding: 24px 16px 40px; gap: 20px; }
  .apps-head { justify-items: start; text-align: left; }
  .apps-head h1 { font-size: 24px; }
  .app-grid { grid-template-columns: 1fr; gap: 10px; }
  .app-grid .tile {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "icon label chip" "icon text chip";
    align-items: center;
    gap: 2px 14px;
    min-height: 76px;
    padding: 14px 16px;
    text-align: left;
  }
  .app-grid .tile > .icon, .app-grid .tile > .tile-image { grid-area: icon; width: 36px; height: 36px; margin: 0; }
  .app-grid .tile-label { grid-area: label; align-self: end; }
  .app-grid .tile-description { grid-area: text; align-self: start; }
  .app-grid .tile > .chip { grid-area: chip; }
}
