:root {
  --shared-auth-ink: #172033;
  --shared-auth-muted: #647086;
  --shared-auth-blue: #2563eb;
  --shared-auth-blue-dark: #1d4ed8;
  --shared-auth-line: rgba(23, 32, 51, 0.12);
  --shared-auth-panel: rgba(255, 255, 255, 0.96);
  --shared-auth-bg: rgba(14, 20, 34, 0.55);
}

body.shared-auth-open {
  overflow: hidden;
}

.shared-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  color: var(--shared-auth-ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
}

.shared-auth-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(244, 183, 76, 0.2), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(37, 99, 235, 0.24), transparent 30%),
    var(--shared-auth-bg);
  backdrop-filter: blur(14px);
}

.shared-auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 22px;
  width: min(920px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  margin: 14px auto;
  padding: clamp(18px, 3vw, 30px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(249, 245, 237, 0.94)),
    var(--shared-auth-panel);
  box-shadow:
    0 34px 100px rgba(18, 24, 38, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.shared-auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--shared-auth-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--shared-auth-ink);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.shared-auth-copy {
  display: grid;
  align-content: center;
  gap: 12px;
  min-height: 100%;
  padding: clamp(14px, 3vw, 28px);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 24px;
  background:
    linear-gradient(160deg, rgba(232, 239, 255, 0.9), rgba(255, 251, 244, 0.68));
}

.shared-auth-kicker {
  margin: 0;
  color: #315078;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.shared-auth-copy h2,
.shared-auth-form h3,
.shared-auth-signed-in h3 {
  margin: 0;
  color: #111827;
  letter-spacing: -0.045em;
}

.shared-auth-copy h2 {
  max-width: 100%;
  font-size: clamp(2.2rem, 4.8vw, 3.65rem);
  line-height: 0.96;
  overflow-wrap: anywhere;
}

.shared-auth-copy p,
.shared-auth-signed-in p,
.shared-auth-feedback {
  margin: 0;
  color: var(--shared-auth-muted);
  line-height: 1.55;
}

.shared-auth-signed-out {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
  padding-top: 44px;
}

.shared-auth-form,
.shared-auth-signed-in {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--shared-auth-line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 52px rgba(23, 32, 51, 0.08);
}

.shared-auth-form-muted {
  background: rgba(255, 255, 255, 0.56);
}

.shared-auth-form h3,
.shared-auth-signed-in h3 {
  font-size: 1.25rem;
  line-height: 1.05;
}

.shared-auth-field {
  display: grid;
  gap: 6px;
}

.shared-auth-field span {
  color: #41506a;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.shared-auth-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid rgba(23, 32, 51, 0.14);
  border-radius: 14px;
  background: #fff;
  color: var(--shared-auth-ink);
  font: inherit;
  font-weight: 700;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(23, 32, 51, 0.04);
}

.shared-auth-field input:focus {
  border-color: rgba(37, 99, 235, 0.62);
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.12),
    inset 0 1px 0 rgba(23, 32, 51, 0.04);
}

.shared-auth-primary,
.shared-auth-secondary {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.shared-auth-primary {
  border: 1px solid rgba(37, 99, 235, 0.88);
  background: linear-gradient(180deg, #2f73ff, var(--shared-auth-blue-dark));
  color: #fff;
  box-shadow: 0 15px 32px rgba(37, 99, 235, 0.24);
}

.shared-auth-secondary {
  border: 1px solid rgba(23, 32, 51, 0.14);
  background: #fff;
  color: var(--shared-auth-ink);
}

.shared-auth-primary:disabled,
.shared-auth-secondary:disabled {
  cursor: wait;
  opacity: 0.62;
}

.shared-auth-signed-in {
  align-self: center;
  padding-top: 44px;
}

.shared-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.shared-auth-feedback {
  grid-column: 2;
  padding: 12px 14px;
  border: 1px solid rgba(23, 32, 51, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.shared-auth-feedback.is-error {
  border-color: rgba(190, 18, 60, 0.22);
  background: rgba(255, 241, 242, 0.9);
  color: #9f1239;
}

.shared-auth-feedback.is-success {
  border-color: rgba(22, 101, 52, 0.2);
  background: rgba(240, 253, 244, 0.92);
  color: #166534;
}

.shared-auth-feedback.is-info {
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(239, 246, 255, 0.9);
  color: #1d4ed8;
}

@media (max-width: 760px) {
  .shared-auth-shell {
    grid-template-columns: 1fr;
    align-content: start;
    width: min(100vw - 16px, 520px);
    max-height: calc(100vh - 16px);
    margin: 8px auto;
    padding: 14px;
    border-radius: 24px;
  }

  .shared-auth-copy {
    padding: 18px;
  }

  .shared-auth-copy h2 {
    max-width: 100%;
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .shared-auth-signed-out {
    grid-template-columns: 1fr;
    padding-top: 0;
  }

  .shared-auth-signed-in {
    padding-top: 0;
  }

  .shared-auth-feedback {
    grid-column: 1;
  }
}
