/* Auth — tema premium escuro */
:root {
  --bg: #0a0a0f;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-border: rgba(255, 255, 255, 0.08);
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --accent: #e8c547;
  --accent-strong: #c9a227;
  --accent-glow: rgba(201, 162, 39, 0.35);
  --gold: #d4af37;
  --error: #f87171;
  --error-bg: rgba(248, 113, 113, 0.12);
  --success: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --font: "DM Sans", system-ui, sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  -webkit-font-smoothing: antialiased;
}

body.auth-page {
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}

.auth-brand__logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 1.25rem;
  filter: drop-shadow(0 8px 24px rgba(212, 175, 55, 0.2));
}

.bg-glow--1 {
  width: 420px;
  height: 420px;
  background: #c9a227;
  opacity: 0.22;
  top: -120px;
  right: -80px;
}

.bg-glow--2 {
  width: 360px;
  height: 360px;
  background: #1a1a1f;
  opacity: 0.16;
  bottom: -100px;
  left: -60px;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

@media (max-width: 860px) {
  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .auth-brand {
    text-align: center;
  }

  .auth-brand__logo {
    margin-inline: auto;
  }
}

.auth-brand__logo svg {
  width: 56px;
  height: 56px;
  display: block;
  margin-bottom: 1.25rem;
}

.auth-brand__title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.auth-brand__text {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 320px;
}

@media (max-width: 860px) {
  .auth-brand__text {
    margin-inline: auto;
  }
}

/* Card */
.auth-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.auth-card__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 1.75rem;
}

.auth-tab {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: color var(--transition);
}

.auth-tab.is-active {
  color: var(--text);
}

.auth-card__indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: transform var(--transition);
  pointer-events: none;
}

.auth-card__tabs[data-active="register"] .auth-card__indicator {
  transform: translateX(100%);
}

.auth-card__heading {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.auth-card__sub {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.auth-panel {
  display: none;
  animation: fadeIn 0.35s ease;
}

.auth-panel.is-active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fields */
.field {
  margin-bottom: 1rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 400px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.label-hint {
  font-weight: 400;
  opacity: 0.75;
}

.field input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field input::placeholder {
  color: #52525b;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field-password {
  position: relative;
}

.field-password input {
  padding-right: 2.75rem;
}

.btn-toggle-pw {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}

.btn-toggle-pw:hover {
  color: var(--text);
}

/* Checkbox */
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 1.25rem 0 1.5rem;
  cursor: pointer;
}

.checkbox input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox__box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1px solid var(--surface-border);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.35);
  margin-top: 2px;
  position: relative;
  transition: background var(--transition), border-color var(--transition);
}

.checkbox input:checked + .checkbox__box {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.checkbox input:checked + .checkbox__box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox a {
  color: var(--accent);
  text-decoration: none;
}

.checkbox a:hover {
  text-decoration: underline;
}

/* Button */
.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-strong), #8b6914);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow var(--transition), opacity var(--transition);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px var(--accent-glow);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Alert */
.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.auth-alert.is-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.auth-alert.is-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(74, 222, 128, 0.25);
}
