/* Platform accounts auth — Website 2.0 tokens. Pair with tokens.css + shell.css. */

html.auth-w2,
html.auth-w2 body {
  min-height: 100%;
  overflow-x: hidden;
  background: var(--color-background) !important;
  color: var(--color-text);
}

html.auth-w2 body,
html.auth-w2 body .auth-app,
html.auth-w2 body .auth-app input,
html.auth-w2 body .auth-app button,
html.auth-w2 body .auth-app label,
html.auth-w2 body .auth-app p,
html.auth-w2 body .auth-app h4,
html.auth-w2 body .auth-app span,
html.auth-w2 body .auth-app a {
  font-family: var(--font-sans, "Plus Jakarta Sans", Inter, system-ui, sans-serif) !important;
}

html.auth-w2 #loader,
html.auth-w2 #particles-js,
html.auth-w2 #fireworks-area,
html.auth-w2 #footer {
  display: none !important;
}

.auth-app,
.auth-app * {
  box-sizing: border-box;
}

html.auth-w2 .auth-app h2,
html.auth-w2 .auth-app h3,
html.auth-w2 .auth-app h4,
html.auth-w2 .auth-app h5 {
  color: var(--color-text) !important;
  text-align: left !important;
  letter-spacing: -0.03em;
}

html.auth-w2 .auth-app h2 {
  font-size: clamp(1.45rem, 2vw, 1.85rem) !important;
  line-height: 1.25 !important;
  font-weight: 800 !important;
}

html.auth-w2 .auth-app h4 {
  font-size: 1.55rem !important;
  line-height: 1.25 !important;
  font-weight: 800 !important;
}

.auth-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-background);
  color: var(--color-text);
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 4;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-text);
}

.auth-brand:hover {
  color: var(--color-text);
  text-decoration: none;
}

.auth-brand img {
  width: 36px;
  height: 36px;
  display: block;
}

.auth-brand__word {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.auth-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 48px;
  min-width: 0;
  background:
    radial-gradient(ellipse 60% 40% at 8% 0%, color-mix(in srgb, var(--color-accent) 10%, transparent), transparent 55%),
    radial-gradient(ellipse 50% 35% at 100% 20%, color-mix(in srgb, var(--color-brand-red) 8%, transparent), transparent 50%),
    var(--color-surface-alt);
}

.auth-shell {
  width: min(980px, 100%);
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(26, 26, 26, 0.08);
  overflow: hidden;
}

html[data-theme="dark"] .auth-shell {
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.auth-panel {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 40px 36px;
  color: var(--color-text);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-panel__inner {
  position: relative;
  z-index: 1;
  max-width: 420px;
  min-width: 0;
}

.auth-panel__visual {
  margin: 0 0 20px;
}

.auth-panel__art {
  display: block;
  width: min(100%, 280px);
  height: auto;
}

.auth-panel__eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.auth-panel__title {
  margin: 0 0 10px;
  color: var(--color-text);
}

.auth-panel__lede {
  margin: 0 0 22px;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.auth-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.auth-panel__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--color-text);
}

.auth-panel__icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--color-surface-alt);
  color: var(--color-accent);
  border: 1px solid var(--color-border);
  display: grid;
  place-items: center;
}

.auth-panel__icon svg {
  width: 18px;
  height: 18px;
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 40px 36px;
  background: var(--color-surface);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  min-width: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  animation: auth-rise 0.45s ease both;
  overflow: hidden;
}

.auth-card__kicker,
.auth-step-label {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.auth-card__title,
.login-header h4 {
  margin: 0 0 8px;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text);
  text-align: left;
}

.auth-card__sub,
.auth-helper {
  margin: 0 0 24px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.auth-helper strong {
  color: var(--color-text);
  letter-spacing: 0.04em;
}

.auth-form {
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.auth-field,
.smart-field {
  display: grid;
  gap: 6px;
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.auth-label {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--color-text);
}

.auth-input,
.auth-form .form-control,
.smart-field .auth-input,
.smart-field input.button2:not(.auth-visually-hidden):not(.auth-digit) {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-background);
  color: var(--color-text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

html.auth-w2 .auth-app .button2:not(.auth-digit) {
  background: var(--color-background);
  color: var(--color-text);
  border-color: var(--color-border);
}

.auth-input:focus,
.auth-form .form-control:focus,
.smart-field input.button2:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap .auth-input,
.auth-input-wrap .form-control,
.auth-input-wrap input.button2 {
  padding-right: 48px;
}

.auth-toggle-pw,
.password-toggle-btn,
.smart-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 8px;
}

.auth-toggle-pw:hover,
.password-toggle-btn:hover,
.smart-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-alt);
}

.smart-toggle.toggle-hide,
.toggle-hide {
  display: none;
}

.smart-toggle.toggle-active .toggle-show,
.smart-toggle.active .toggle-show {
  display: none;
}

.smart-toggle.toggle-active .toggle-hide,
.smart-toggle.active .toggle-hide {
  display: block;
}

.auth-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.auth-error,
.error-message {
  margin: 0;
  color: var(--color-error);
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.error-message.show,
.auth-error.show {
  opacity: 1;
  transform: translateY(0);
}

.smart-field.error .auth-input,
.smart-field.error input.button2 {
  border-color: var(--color-error);
}

.auth-messages {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.auth-messages .alert {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.auth-btn,
.neural-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 700;
  font-size: 0.98rem;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.auth-btn:hover,
.neural-button:hover {
  filter: brightness(1.05);
}

.auth-btn:active,
.neural-button:active {
  transform: translateY(1px);
}

.auth-btn:disabled,
.neural-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.auth-btn--ghost {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.button-text {
  position: relative;
  z-index: 2;
}

.button-loader {
  position: absolute;
  z-index: 2;
  opacity: 0;
}

.neural-button.loading .button-text,
.auth-btn.loading .button-text {
  opacity: 0;
}

.neural-button.loading .button-loader,
.auth-btn.loading .button-loader {
  opacity: 1;
}

.neural-spinner {
  display: flex;
  gap: 4px;
}

.spinner-segment {
  width: 4px;
  height: 16px;
  background: var(--color-on-primary);
  border-radius: 2px;
  animation: auth-bar 1.2s ease-in-out infinite;
}

.spinner-segment:nth-child(2) { animation-delay: 0.1s; }
.spinner-segment:nth-child(3) { animation-delay: 0.2s; }

.auth-link,
.neural-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--color-accent);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}

.auth-link:hover,
.neural-link:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

.auth-footer-row,
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.auth-digits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 52px));
  justify-content: start;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.auth-digits[data-auth-digits="otp"],
.auth-digits[data-auth-digits="otp-forgot"] {
  grid-template-columns: repeat(6, minmax(0, 44px));
  gap: 8px;
}

.auth-digit {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0;
  box-sizing: border-box;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-background);
  color: var(--color-text);
  caret-color: var(--color-accent);
}

.auth-digit:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
}

.auth-digits.is-complete .auth-digit {
  animation: auth-pulse 0.35s ease;
  border-color: color-mix(in srgb, var(--color-accent) 55%, var(--color-border));
}

.auth-visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.d-none {
  display: none !important;
}

.otp-sent-hint {
  margin-top: 4px;
}

.resend-otp-btn.smart-toggle {
  position: static;
  transform: none;
  width: auto;
  height: auto;
  padding: 0;
  color: var(--color-accent);
  font-weight: 650;
}

.resend-otp-btn.smart-toggle:hover {
  background: transparent;
  text-decoration: underline;
}

@keyframes auth-mesh {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-3%, 4%, 0) scale(1.06); }
}

@keyframes auth-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes auth-bar {
  0%, 80%, 100% { transform: scaleY(0.5); opacity: 0.5; }
  40% { transform: scaleY(1); opacity: 1; }
}

@media (max-width: 900px) {
  .auth-stage {
    padding: 16px 12px 32px;
    align-items: flex-start;
  }

  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
    box-shadow: none;
    border: 0;
    background: transparent;
  }

  .auth-panel {
    display: none;
  }

  .auth-main {
    padding: 8px 4px 24px;
    align-items: flex-start;
    background: transparent;
  }

  .auth-card {
    width: 100%;
    max-width: 100%;
    animation: none;
  }

  .auth-digits[data-auth-digits="otp"],
  .auth-digits[data-auth-digits="otp-forgot"] {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .auth-digits {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 280px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-panel__mesh,
  .auth-card,
  .auth-digits.is-complete .auth-digit,
  .spinner-segment,
  .auth-btn,
  .neural-button {
    animation: none !important;
    transition: none !important;
  }
}
