:root {
  --auth-navy: var(--rh-navy, #0d1b4c);
  --auth-blue: var(--rh-retro-blue, #5a98d9);
  --auth-red: var(--rh-red, #d62828);
  --auth-orange: var(--rh-orange, #f26b38);
  --auth-white: var(--rh-bg, #f8fafc);
  --auth-muted: var(--rh-text-muted, #667085);
  --auth-line: rgba(13, 27, 76, .14);
  --auth-shadow: 0 28px 80px rgba(13, 27, 76, .28);
}

.auth-trigger {
  position: relative;
  display: inline-grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--auth-line);
  border-radius: 15px;
  color: var(--auth-navy);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 22px rgba(13, 27, 76, .1);
  cursor: pointer;
}

.auth-trigger[data-authenticated="true"] {
  border-color: rgba(78, 122, 78, .35);
  background: rgba(78, 122, 78, .1);
}

.auth-trigger > svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.auth-trigger-avatar {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: var(--auth-red);
  font-size: 9px;
  font-weight: 900;
}
.auth-trigger-avatar[hidden] { display: none; }

.auth-screen-active .app-nav,
.auth-screen-active .catalog-context-action { display: none !important; }
.auth-route-shell {
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
  background:
    radial-gradient(circle at 12% 18%, rgba(242, 107, 56, .11), transparent 30%),
    radial-gradient(circle at 90% 4%, rgba(90, 152, 217, .14), transparent 31%),
    var(--auth-white);
}
.auth-route-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 14px 6px;
  color: var(--auth-navy);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}
.auth-route-header .catalog-icon-btn { width: 44px; min-width: 44px; height: 44px; }

.auth-dialog {
  width: min(calc(100% - 24px), 500px);
  max-height: min(90dvh, 760px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 28px;
  color: var(--auth-navy);
  background: #fff;
  box-shadow: var(--auth-shadow);
}

.auth-dialog::backdrop { background: rgba(13, 27, 76, .62); backdrop-filter: blur(5px); }
.auth-page {
  width: min(100%, 540px);
  min-height: calc(100dvh - 92px);
  box-sizing: border-box;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 12px calc(30px + env(safe-area-inset-bottom));
  color: var(--auth-navy);
}
.auth-page .auth-panel {
  border: 1px solid var(--auth-line);
  border-radius: 28px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 52px rgba(13, 27, 76, .12);
}
.auth-wordmark { display: block; width: min(235px, 70%); height: auto; margin: 2px auto 24px; object-fit: contain; }
.auth-panel { padding: 22px; }
.auth-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.auth-heading-copy { min-width: 0; }
.auth-eyebrow { color: var(--auth-red); font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.auth-title { margin: 4px 0 0; font-size: clamp(24px, 7vw, 31px); letter-spacing: -.04em; line-height: 1.06; }

.auth-close,
.auth-primary,
.auth-secondary,
.auth-danger,
.auth-delete-open,
.auth-provider {
  min-height: 48px;
  border-radius: 15px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.auth-close {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--auth-line);
  color: var(--auth-navy);
  background: #fff;
  font-size: 18px;
  text-transform: uppercase;
}

.auth-content { margin-top: 18px; }
.auth-intro,
.auth-privacy,
.auth-help,
.auth-ready,
.auth-email { color: var(--auth-muted); line-height: 1.5; }
.auth-intro { margin: 0 0 18px; font-size: 15px; }
.auth-privacy { margin: 16px 0 0; font-size: 12px; }
.auth-label { display: block; margin: 0 0 7px; font-size: 13px; font-weight: 850; }
.auth-label-spaced { margin-top: 14px; }

.auth-input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  box-sizing: border-box;
  padding: 0 14px;
  border: 1px solid var(--auth-line);
  border-radius: 14px;
  color: var(--auth-navy);
  background: var(--auth-white);
  font: inherit;
}

.auth-primary {
  width: 100%;
  margin-top: 12px;
  padding: 0 18px;
  border: 0;
  color: #fff;
  background: var(--auth-red);
  box-shadow: 0 10px 22px rgba(214, 40, 40, .2);
}

.auth-divider { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 17px 0; color: var(--auth-muted); font-size: 12px; }
.auth-divider span { height: 1px; background: var(--auth-line); }
.auth-divider b { font-weight: 700; }
.auth-providers { display: grid; gap: 9px; }
.auth-provider { display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%; border: 1px solid var(--auth-line); color: var(--auth-navy); background: #fff; }
.auth-provider-icon { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; font-size: 16px; font-weight: 900; }
.auth-provider-google .auth-provider-icon { color: #325cc8; background: #edf3ff; }
.auth-provider-facebook .auth-provider-icon { color: #fff; background: #1877f2; }

.auth-unavailable { margin: 0 0 16px; padding: 12px 14px; border: 1px solid rgba(242, 107, 56, .25); border-radius: 14px; color: #7d3b23; background: rgba(242, 107, 56, .09); font-size: 13px; line-height: 1.45; }
.auth-handle-field { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; border: 1px solid var(--auth-line); border-radius: 14px; background: var(--auth-white); }
.auth-handle-prefix { padding-left: 14px; color: var(--auth-muted); font-weight: 800; }
.auth-handle-input { border: 0; background: transparent; }
.auth-help { margin: 7px 2px 0; font-size: 12px; }

.auth-identity { display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--auth-line); border-radius: 18px; background: var(--auth-white); }
.auth-avatar { display: grid; width: 52px; min-width: 52px; height: 52px; place-items: center; border-radius: 17px; color: #fff; background: linear-gradient(145deg, var(--auth-red), var(--auth-orange)); font-size: 21px; font-weight: 900; }
.auth-identity-copy { display: grid; min-width: 0; gap: 2px; }
.auth-identity-copy strong,
.auth-identity-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-email { font-size: 12px; }
.auth-ready { margin: 14px 0; font-size: 14px; }
.auth-secondary { width: 100%; padding: 0 16px; border: 1px solid var(--auth-line); color: var(--auth-navy); background: #fff; }
.auth-guest-continue { margin-top: 12px; }
.auth-friends-open { margin-top: 0; }
.auth-signout { margin-top: 9px; }
.auth-delete-open { width: 100%; margin-top: 10px; border: 0; color: #a52222; background: transparent; }

.auth-delete-confirm { margin-top: 14px; padding: 15px; border: 1px solid rgba(214, 40, 40, .24); border-radius: 16px; background: rgba(214, 40, 40, .06); }
.auth-delete-confirm h3 { margin: 0; font-size: 17px; }
.auth-delete-confirm p { margin: 7px 0 13px; color: var(--auth-muted); font-size: 13px; line-height: 1.45; }
.auth-delete-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.auth-danger { border: 0; color: #fff; background: #a52222; }

.auth-status { min-height: 20px; margin-top: 14px; color: var(--auth-muted); font-size: 13px; font-weight: 700; line-height: 1.4; }
.auth-status:empty { min-height: 0; margin-top: 0; }
.auth-loading-mark { display: grid; width: 56px; height: 56px; margin: 26px auto 12px; place-items: center; border-radius: 18px; color: #fff; background: var(--auth-navy); font-weight: 900; }
.auth-loading-copy { margin: 0 0 24px; color: var(--auth-muted); text-align: center; }

.auth-content[aria-busy="true"] { cursor: progress; }
.auth-content button:disabled,
.auth-content input:disabled { cursor: not-allowed; opacity: .52; }
.auth-dialog :focus-visible,
.auth-trigger:focus-visible,
.auth-route-shell :focus-visible { outline: 3px solid rgba(90, 152, 217, .72); outline-offset: 3px; }
.auth-route-shell .auth-title[tabindex="-1"]:focus { outline: 0; box-shadow: none; }
.auth-route-shell .auth-title[tabindex="-1"]:focus-visible { outline: 0; box-shadow: none; }

@media (max-width: 350px) {
  .auth-dialog { width: calc(100% - 12px); border-radius: 22px; }
  .auth-panel { padding: 17px; }
  .auth-page { padding-inline: 6px; }
  .auth-title { font-size: 23px; }
  .auth-delete-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-dialog,
  .auth-dialog::backdrop,
  .auth-dialog * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
