/* Shared public authentication polish. Page-specific auth styles remain
   responsible for branding and layout details; this file owns the common
   controls, focus treatment and small-screen behavior. */
.auth-shell {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 78% 10%, rgba(245, 166, 35, 0.08), transparent 34rem),
    #080b12;
}

.auth-shell .auth-container {
  min-height: 100dvh;
}

.auth-shell .auth-container:not(.has-auth-side) {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 24px 16px;
}

.auth-shell .auth-simple-card {
  overflow: hidden;
  position: relative;
  background: rgba(16, 20, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  max-width: 460px;
  padding: clamp(24px, 5vw, 42px);
  width: 100%;
}

.auth-shell .auth-simple-card::after {
  content: '';
  position: absolute;
  width: 210px;
  height: 76px;
  right: -70px;
  bottom: -42px;
  border: 1px solid rgba(245, 166, 35, 0.24);
  border-radius: 50%;
  transform: rotate(-10deg);
  pointer-events: none;
}

.auth-shell .auth-simple-card > * {
  position: relative;
  z-index: 1;
}

.auth-shell .auth-form-panel {
  min-height: 100dvh;
  scrollbar-gutter: stable;
}

.auth-shell .auth-card {
  color: var(--text-primary, #eef1f8);
}

.auth-shell .auth-card h1,
.auth-shell .auth-card h2,
.auth-shell .auth-card h3 {
  text-wrap: balance;
}

.auth-shell .form-label {
  color: var(--text-primary, #eef1f8);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  margin-bottom: 0.45rem;
}

.auth-shell .form-control,
.auth-shell .form-select {
  min-height: 46px;
  border-radius: 10px;
  border-color: rgba(255, 255, 255, 0.13);
  background-color: rgba(16, 20, 28, 0.82);
  color: var(--text-primary, #eef1f8);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.auth-shell .form-control::placeholder {
  color: var(--text-muted, #64748b);
  opacity: 1;
}

.auth-shell .form-control:hover,
.auth-shell .form-select:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.auth-shell .form-control:focus,
.auth-shell .form-select:focus {
  background-color: rgba(16, 20, 28, 0.98);
  outline: none;
}

.auth-shell .input-group > .btn {
  min-width: 48px;
  border-radius: 0 10px 10px 0;
}

.auth-shell .btn-primary {
  min-height: 46px;
  border-radius: 10px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.auth-shell a {
  text-underline-offset: 3px;
}

.auth-shell a:focus-visible,
.auth-shell button:focus-visible,
.auth-shell input:focus-visible,
.auth-shell select:focus-visible {
  outline: 3px solid rgba(245, 166, 35, 0.42);
  outline-offset: 2px;
}

.auth-shell .alert {
  border-radius: 10px;
}

@media (max-width: 900px) {
  .auth-shell .auth-container.has-auth-side {
    display: block;
    min-height: 100dvh;
  }

  .auth-shell .auth-container.has-auth-side .auth-side {
    display: none;
  }

  .auth-shell .auth-container.has-auth-side .auth-form-panel {
    min-height: 100dvh;
    padding: 32px 18px;
  }
}

@media (max-width: 420px) {
  .auth-shell .auth-form-panel {
    padding-inline: 14px;
  }

  .auth-shell .auth-trust-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-shell *,
  .auth-shell *::before,
  .auth-shell *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Authentication screens share the home page atmosphere while keeping every
   existing form id, action and JavaScript hook intact. */
.auth-shell {
  background:
    radial-gradient(circle at 16% 12%, rgba(139, 124, 255, 0.11), transparent 28rem),
    radial-gradient(circle at 88% 82%, rgba(53, 201, 232, 0.08), transparent 24rem),
    #080b12;
}

.auth-shell .auth-container {
  position: relative;
  isolation: isolate;
}

.auth-shell .auth-container::before,
.auth-shell .auth-container::after {
  content: '';
  position: fixed;
  z-index: -1;
  width: 34vw;
  height: 13vw;
  min-width: 280px;
  min-height: 110px;
  border: 1px solid rgba(139, 124, 255, 0.16);
  border-radius: 50%;
  transform: rotate(-12deg);
  pointer-events: none;
}

.auth-shell .auth-container::before {
  top: 8%;
  right: -10%;
  box-shadow: 0 0 34px rgba(139, 124, 255, 0.08);
}

.auth-shell .auth-container::after {
  bottom: 4%;
  left: -12%;
  border-color: rgba(53, 201, 232, 0.13);
}

.auth-shell .auth-card,
.auth-shell .auth-simple-card {
  border-color: rgba(139, 124, 255, 0.22);
  background: linear-gradient(145deg, rgba(139, 124, 255, 0.08), transparent 38%), rgba(16, 20, 28, 0.82);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(18px);
}

.auth-shell .auth-card::before,
.auth-shell .auth-simple-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), #8b7cff, transparent);
  opacity: 0.85;
}

.auth-shell .auth-card h2,
.auth-shell .auth-simple-card h2 {
  letter-spacing: -0.5px;
}

.auth-shell .form-control,
.auth-shell .form-select {
  border-color: rgba(139, 124, 255, 0.2);
  background: rgba(8, 11, 18, 0.64);
}

.auth-shell .form-control:focus,
.auth-shell .form-select:focus {
  border-color: #8b7cff;
  box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.16), 0 0 24px rgba(139, 124, 255, 0.11);
}

.auth-shell .btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 10px 26px rgba(245, 166, 35, 0.2);
}

.auth-shell .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(245, 166, 35, 0.3);
}

.auth-shell .auth-home-link,
.auth-shell .auth-trust-item i,
.auth-shell .auth-side-feature i {
  color: var(--accent-light);
}

@media (max-width: 900px) {
  .auth-shell .auth-form-panel {
    background: linear-gradient(180deg, rgba(139, 124, 255, 0.035), transparent 35%);
  }
}

/* Keep the shared auth polish readable when the application uses its light theme. */
html[data-theme="light"] .auth-shell {
  color: #0b1220;
  background:
    radial-gradient(circle at 16% 12%, rgba(245, 166, 35, 0.10), transparent 28rem),
    radial-gradient(circle at 88% 82%, rgba(102, 93, 184, 0.08), transparent 24rem),
    #f4f7fb;
}

html[data-theme="light"] .auth-shell .auth-container::before,
html[data-theme="light"] .auth-shell .auth-container::after {
  border-color: rgba(102, 93, 184, 0.16);
  box-shadow: none;
}

html[data-theme="light"] .auth-shell .auth-side {
  color: #334155;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 253, 0.96));
  border-right-color: #d8e0eb;
}

html[data-theme="light"] .auth-shell .auth-form-panel {
  background:
    radial-gradient(ellipse at 75% 20%, rgba(245, 166, 35, 0.10), transparent 50%),
    #f4f7fb;
}

html[data-theme="light"] .auth-shell .auth-card,
html[data-theme="light"] .auth-shell .auth-simple-card {
  color: #0b1220 !important;
  border-color: #cbd5e1 !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 253, 0.98)) !important;
  box-shadow: 0 22px 56px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(102, 93, 184, 0.08) !important;
}

html[data-theme="light"] .auth-shell .auth-card::before,
html[data-theme="light"] .auth-shell .auth-simple-card::before {
  background: linear-gradient(90deg, transparent, #c87508, #665db8, transparent);
}

html[data-theme="light"] .auth-shell .auth-card h1,
html[data-theme="light"] .auth-shell .auth-card h2,
html[data-theme="light"] .auth-shell .auth-card h3,
html[data-theme="light"] .auth-shell .auth-simple-card h1,
html[data-theme="light"] .auth-shell .auth-simple-card h2,
html[data-theme="light"] .auth-shell .auth-simple-card h3 {
  color: #0b1220 !important;
}

html[data-theme="light"] .auth-shell .auth-card .text-muted,
html[data-theme="light"] .auth-shell .auth-simple-card .text-muted,
html[data-theme="light"] .auth-shell .auth-trust-item,
html[data-theme="light"] .auth-shell .auth-side-proof {
  color: #475569 !important;
}

html[data-theme="light"] .auth-shell .form-label {
  color: #334155 !important;
}

html[data-theme="light"] .auth-shell .form-control,
html[data-theme="light"] .auth-shell .form-select {
  border-color: #cbd5e1 !important;
  background: #ffffff !important;
  color: #0b1220 !important;
}

html[data-theme="light"] .auth-shell .form-control::placeholder {
  color: #64748b !important;
}

html[data-theme="light"] .auth-shell .form-control:hover,
html[data-theme="light"] .auth-shell .form-select:hover {
  border-color: #94a3b8 !important;
}

html[data-theme="light"] .auth-shell .form-control:focus,
html[data-theme="light"] .auth-shell .form-select:focus {
  border-color: #c87508 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(200, 117, 8, 0.16), 0 0 20px rgba(200, 117, 8, 0.08) !important;
}

html[data-theme="light"] .auth-shell .input-group > .btn.btn-outline-light {
  color: #334155 !important;
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
}

html[data-theme="light"] .auth-shell .auth-side-stat,
html[data-theme="light"] .auth-shell .auth-ticker {
  border-color: #d7dfeb !important;
  background: rgba(255, 255, 255, 0.82) !important;
}

html[data-theme="light"] .auth-shell .auth-side-stat-num,
html[data-theme="light"] .auth-shell .auth-ticker-sym,
html[data-theme="light"] .auth-shell .auth-side-feature strong {
  color: #0b1220 !important;
}

html[data-theme="light"] .auth-shell .auth-side-badge {
  color: #9a5a00 !important;
  border-color: rgba(200, 117, 8, 0.28) !important;
  background: rgba(245, 166, 35, 0.10) !important;
}

html[data-theme="light"] .auth-shell .auth-trust-row {
  border-top-color: #d7dfeb !important;
}

html[data-theme="light"] .auth-shell .referral-box {
  border-color: rgba(200, 117, 8, 0.42) !important;
  background: rgba(245, 166, 35, 0.08) !important;
}

html[data-theme="light"] .auth-shell .referral-box-label {
  color: #9a5a00 !important;
}

html[data-theme="light"] .auth-shell .form-control:-webkit-autofill,
html[data-theme="light"] .auth-shell .form-control:-webkit-autofill:hover,
html[data-theme="light"] .auth-shell .form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: #0b1220 !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  caret-color: #0b1220;
}

/* Long auth forms must scroll with the document. A fixed 100vh grid plus a
   second scroll box made the submit controls unreachable at normal zoom. */
.auth-shell {
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
}

.auth-shell .auth-container.has-auth-side {
  height: auto;
  min-height: 100dvh;
  align-items: stretch;
}

.auth-shell .auth-container.has-auth-side .auth-side,
.auth-shell .auth-container.has-auth-side .auth-form-panel {
  min-height: 100dvh;
  overflow: visible;
}

.auth-shell .auth-container.has-auth-side .auth-form-panel {
  align-items: flex-start;
  padding-block: clamp(32px, 7vh, 72px);
}

@media (max-width: 900px) {
  .auth-shell .auth-container.has-auth-side .auth-form-panel {
    min-height: 0;
    padding-block: 32px 40px;
  }
}
