/* Auth pages — black / white / silver. Class names match existing Cognito JS. */

:root {
  --sx-black: #000;
  --sx-white: #fff;
  --sx-muted: rgba(255, 255, 255, 0.45);
  --sx-border: rgba(255, 255, 255, 0.1);
  --sx-card: #0a0a0a;
  --sx-silver: linear-gradient(135deg, #888 0%, #d4d4d4 40%, #f5f5f5 50%, #d4d4d4 60%, #888 100%);
  --sx-font: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --sx-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sx-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sx-green: #22c55e;
}

*, *::before, *::after { box-sizing: border-box; }

html.dark body.auth-page,
body.auth-page {
  margin: 0;
  min-height: 100vh;
  background: var(--sx-black);
  color: var(--sx-white);
  font-family: var(--sx-font);
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  position: relative;
  overflow-x: hidden;
}

.auth-grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(255,255,255,0.04), transparent 60%),
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  opacity: 0.5;
  z-index: 0;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--sx-card);
  border: 1px solid var(--sx-border);
  border-radius: 16px;
  padding: 36px 32px 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.auth-logo a {
  text-decoration: none;
}

.auth-logo .sx-wordmark {
  font-family: var(--sx-font);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  background: var(--sx-silver);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-logo img {
  display: none; /* text logo preferred; keep img in DOM if needed */
}

.auth-title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-align: center;
  color: var(--sx-white);
}

.auth-sub {
  margin: 0 0 24px;
  text-align: center;
  color: var(--sx-muted);
  font-size: 14px;
  line-height: 1.5;
}

.auth-alert {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid transparent;
}

.auth-alert:not(:empty) {
  display: block;
}

.auth-alert.error,
.auth-alert:not(.success):not(:empty) {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
}

.auth-alert.success {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.28);
  color: #86efac;
}

.auth-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #000;
  color: #fff;
  font-family: var(--sx-font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s var(--sx-ease), background 0.2s var(--sx-ease);
}

.auth-google:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: #0a0a0a;
}

.auth-google svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--sx-muted);
  font-size: 12px;
  font-family: var(--sx-mono);
  letter-spacing: 0.04em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sx-border);
}

.auth-divider span {
  white-space: nowrap;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sx-muted);
  font-family: var(--sx-mono);
}

.auth-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #000;
  color: #fff;
  font-family: var(--sx-font);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s var(--sx-ease);
}

.auth-field input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.auth-field input:focus {
  border-color: rgba(255, 255, 255, 0.35);
}

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

.auth-field-wrap input {
  padding-right: 44px;
}

.auth-pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--sx-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

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

.auth-pw-toggle:hover {
  color: #fff;
}

.auth-forgot {
  text-align: right;
  margin-top: -4px;
}

.auth-forgot a {
  color: var(--sx-muted);
  font-size: 13px;
  text-decoration: none;
}

.auth-forgot a:hover {
  color: #fff;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  border: none;
  border-radius: 10px;
  background: var(--sx-silver);
  color: #000;
  font-family: var(--sx-font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s var(--sx-ease), transform 0.2s var(--sx-ease);
}

.auth-submit:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: scale(1.01);
}

.auth-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.auth-terms,
.auth-switch {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--sx-muted);
  line-height: 1.5;
}

.auth-terms a,
.auth-switch a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.auth-terms a:hover,
.auth-switch a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

#resetStep,
#confirmStep {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 28px 20px 22px;
  }
}
