/* ==========================================================================
   STREAM GOLD - TELA DE AUTENTICAÇÃO (LOGIN & REGISTRO)
   Estética Glassmorphism Premium, Fluidez, Micro-animações e Suporte Dark/Light
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Dancing+Script:wght@600;700&family=Inter:wght@300;400;500;600;700;800&family=Roboto:wght@400;500;700&display=swap');

:root {
  --primary-gold: #FFD700;
  --primary-gold-hover: #FFE234;
  --secondary-gold: #FFA500;
  --dark-gold: #D48800;
  --gold-glow-color: rgba(255, 215, 0, 0.4);
  --gold-gradient: linear-gradient(135deg, #FFF099 0%, #FFD700 35%, #FFA500 75%, #D48800 100%);
  --gold-gradient-hover: linear-gradient(135deg, #FFF4B8 0%, #FFE234 35%, #FFB41F 75%, #E59500 100%);

  /* Tema Escuro (Padrão) */
  --bg-main: #08090d;
  --bg-gradient: radial-gradient(circle at 50% 0%, #171922 0%, #08090d 100%);
  --card-bg: rgba(18, 20, 29, 0.72);
  --card-border: rgba(255, 215, 0, 0.16);
  --card-border-focus: rgba(255, 215, 0, 0.45);
  --card-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.8), 0 0 45px rgba(255, 180, 0, 0.08);
  
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-border: rgba(255, 255, 255, 0.12);
  --input-border-focus: #FFD700;
  --input-color: #f3f4f6;
  --input-placeholder: #8b92a2;
  --input-icon: #9ca3af;

  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-subtle: #6b7280;

  --tab-bg: rgba(255, 255, 255, 0.06);
  --tab-active-bg: rgba(255, 215, 0, 0.16);
  --tab-active-border: rgba(255, 215, 0, 0.4);
  --tab-active-text: #FFD700;

  --badge-bg: rgba(255, 215, 0, 0.12);
  --badge-border: rgba(255, 215, 0, 0.25);
  --badge-text: #FFD700;

  --orb-1: rgba(255, 215, 0, 0.14);
  --orb-2: rgba(255, 140, 0, 0.11);
  --orb-3: rgba(10, 132, 255, 0.10);
}

[data-theme="light"] {
  /* Tema Claro */
  --bg-main: #f1f4f9;
  --bg-gradient: radial-gradient(circle at 50% 0%, #ffffff 0%, #e2e8f0 100%);
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(212, 136, 0, 0.22);
  --card-border-focus: rgba(212, 136, 0, 0.6);
  --card-shadow: 0 24px 60px -12px rgba(100, 116, 139, 0.25), 0 0 35px rgba(255, 180, 0, 0.12);

  --input-bg: rgba(241, 245, 249, 0.85);
  --input-border: rgba(203, 213, 225, 0.9);
  --input-border-focus: #D48800;
  --input-color: #0f172a;
  --input-placeholder: #64748b;
  --input-icon: #64748b;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;

  --tab-bg: rgba(0, 0, 0, 0.05);
  --tab-active-bg: rgba(212, 136, 0, 0.14);
  --tab-active-border: rgba(212, 136, 0, 0.4);
  --tab-active-text: #b45309;

  --badge-bg: rgba(212, 136, 0, 0.12);
  --badge-border: rgba(212, 136, 0, 0.25);
  --badge-text: #b45309;

  --orb-1: rgba(255, 215, 0, 0.22);
  --orb-2: rgba(255, 165, 0, 0.18);
  --orb-3: rgba(14, 165, 233, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ================== AMBIENT ORBS & BACKGROUND ================== */
.ambient-container {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.85;
  will-change: transform;
}

.orb-1 {
  width: 440px;
  height: 440px;
  background: var(--orb-1);
  top: -80px;
  left: 15%;
  animation: floatOrb1 18s ease-in-out infinite alternate;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: var(--orb-2);
  bottom: -100px;
  right: 15%;
  animation: floatOrb2 22s ease-in-out infinite alternate;
}

.orb-3 {
  width: 320px;
  height: 320px;
  background: var(--orb-3);
  top: 40%;
  right: 5%;
  animation: floatOrb3 15s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.08); }
  100% { transform: translate(-30px, 70px) scale(0.95); }
}

@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-70px, -50px) scale(1.1); }
  100% { transform: translate(40px, -80px) scale(0.92); }
}

@keyframes floatOrb3 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 30px) scale(1.15); }
  100% { transform: translate(30px, -40px) scale(0.9); }
}

/* Malha sutil de fundo */
.ambient-grid {
  position: fixed;
  inset: 0;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  pointer-events: none;
  z-index: 1;
}

[data-theme="light"] .ambient-grid {
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
}

/* ================== TOPO: CONTROLES DE NAVEGAÇÃO ================== */
.auth-top-bar {
  position: fixed;
  top: 20px;
  left: 0;
  right: 0;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  z-index: 10;
}

.auth-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.auth-nav-btn:hover {
  border-color: var(--primary-gold);
  color: var(--primary-gold);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 215, 0, 0.15);
}

.auth-nav-btn i {
  font-size: 13px;
  transition: transform 0.2s ease;
}

.auth-nav-btn:hover i {
  transform: translateX(-3px);
}

.theme-toggle-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.theme-toggle-btn:hover i {
  transform: rotate(20deg);
}

/* ================== CONTAINER PRINCIPAL (CARD GLASS) ================== */
.auth-wrapper {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 460px;
  margin: auto;
  padding-top: 40px;
  padding-bottom: 24px;
}

.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 40px 36px 36px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Linha de reflexo dourado no topo do card */
.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 215, 0, 0.2) 20%, 
    rgba(255, 215, 0, 0.8) 50%, 
    rgba(255, 215, 0, 0.2) 80%, 
    transparent 100%
  );
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
}

/* Brilho suave interior */
.glass-card::after {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 120px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

/* ================== CABEÇALHO DO CARD ================== */
.auth-header {
  text-align: center;
  margin-bottom: 28px;
  position: relative;
  z-index: 2;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--badge-text);
  margin-bottom: 16px;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.12);
}

.brand-badge i {
  font-size: 10px;
  color: var(--primary-gold);
}

.logo-wrapper {
  display: inline-block;
  margin-bottom: 12px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo-wrapper:hover {
  transform: scale(1.04);
}

.logo-wrapper svg {
  height: 40px;
  width: auto;
  display: block;
}

.auth-title {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-bottom: 6px;
}

.auth-subtitle {
  font-family: 'Caveat', 'Dancing Script', cursive;
  font-size: 23px;
  font-weight: 700;
  color: #FFD700;
  letter-spacing: 0.4px;
  line-height: 1.35;
  text-shadow: 0 0 14px rgba(255, 215, 0, 0.35);
  margin-top: 4px;
}

[data-theme="light"] .auth-subtitle {
  color: #b45309;
  text-shadow: none;
}

/* ================== SELETOR DE ABAS (SEGMENTED CONTROL) ================== */
.auth-tabs {
  display: flex;
  background: var(--tab-bg);
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 26px;
  border: 1px solid var(--card-border);
  position: relative;
  z-index: 2;
}

.auth-tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.auth-tab-btn i {
  font-size: 13px;
}

.auth-tab-btn.active {
  background: var(--tab-active-bg);
  color: var(--tab-active-text);
  border: 1px solid var(--tab-active-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15), 0 0 14px rgba(255, 215, 0, 0.12);
}

.auth-tab-btn:hover:not(.active) {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

/* ================== MENSAGEM DE ALERTA ================== */
.auth-alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.4;
  margin-bottom: 22px;
  display: none;
  align-items: center;
  gap: 10px;
  animation: slideDownAlert 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@keyframes slideDownAlert {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-alert.error {
  display: flex;
  background-color: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

[data-theme="light"] .auth-alert.error {
  background-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.3);
}

.auth-alert.success {
  display: flex;
  background-color: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

[data-theme="light"] .auth-alert.success {
  background-color: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.3);
}

.auth-alert i {
  font-size: 15px;
  flex-shrink: 0;
}

/* ================== FORMULÁRIOS & CAMPOS ================== */
.auth-form-panel {
  display: none;
  animation: fadeInForm 0.3s ease;
  position: relative;
  z-index: 2;
}

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

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

.input-group {
  margin-bottom: 20px;
  position: relative;
}

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 8px;
}

.input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.input-box .field-icon {
  position: absolute;
  left: 14px;
  color: var(--input-icon);
  font-size: 15px;
  pointer-events: none;
  transition: color 0.2s ease;
}

.input-field {
  width: 100%;
  height: 48px;
  padding: 0 42px 0 42px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  color: var(--input-color);
  font-family: inherit;
  font-size: 14.5px;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-field::placeholder {
  color: var(--input-placeholder);
  font-size: 14px;
}

.input-field:focus {
  border-color: var(--input-border-focus);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .input-field:focus {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(212, 136, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.06);
}

.input-box:focus-within .field-icon {
  color: var(--primary-gold);
}

/* Botão de Alternar Visibilidade de Senha */
.btn-toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--input-icon);
  padding: 6px;
  cursor: pointer;
  font-size: 15px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.btn-toggle-pass:hover {
  color: var(--primary-gold);
  background: rgba(255, 255, 255, 0.06);
}

/* Indicador de Requisitos de Senha */
.password-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.password-hint i {
  font-size: 11px;
}

/* Linha de Opções (Lembrar-me + Esqueceu a Senha) */
.form-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 13px;
}

.remember-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--text-muted);
}

.remember-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background: var(--input-bg);
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  transition: all 0.2s ease;
}

.remember-check input[type="checkbox"]:checked {
  background: var(--primary-gold);
  border-color: var(--primary-gold);
}

.remember-check input[type="checkbox"]:checked::before {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #000;
  border-bottom: 2px solid #000;
  transform: rotate(-45deg) translate(1px, -1px);
}

.remember-check:hover span {
  color: var(--text-main);
}

.forgot-link {
  color: var(--primary-gold);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.forgot-link:hover {
  text-decoration: underline;
  color: var(--primary-gold-hover);
}

/* ================== BOTÃO DE AÇÃO PRINCIPAL ================== */
.btn-submit-gold {
  width: 100%;
  height: 50px;
  background: var(--gold-gradient);
  border: none;
  border-radius: 12px;
  color: #0b0c10;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(255, 180, 0, 0.35), 0 0 10px rgba(255, 215, 0, 0.2);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

/* Efeito de brilho cintilante ao passar o mouse */
.btn-submit-gold::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 70%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-25deg);
  transition: 0.6s ease;
}

.btn-submit-gold:hover {
  background: var(--gold-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(255, 180, 0, 0.5), 0 0 16px rgba(255, 215, 0, 0.3);
}

.btn-submit-gold:hover::before {
  left: 150%;
}

.btn-submit-gold:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 2px 10px rgba(255, 180, 0, 0.3);
}

.btn-submit-gold:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-submit-gold i {
  font-size: 15px;
  transition: transform 0.2s ease;
}

.btn-submit-gold:hover i:not(.fa-spinner) {
  transform: translateX(3px);
}

/* ================== RODAPÉ DE SEGURANÇA E SUPORTE ================== */
.auth-footer {
  margin-top: 28px;
  text-align: center;
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--card-border);
  padding-top: 20px;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-subtle);
}

.security-badge i {
  color: #10b981;
  font-size: 13px;
}

/* Informações de copyright e versão */
.app-meta-footer {
  text-align: center;
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-subtle);
  position: relative;
  z-index: 5;
}

/* ================== RESPONSIVIDADE ================== */
@media (max-width: 520px) {
  .auth-wrapper {
    padding-top: 60px;
  }

  .glass-card {
    padding: 30px 22px 26px;
    border-radius: 22px;
  }

  .auth-top-bar {
    top: 14px;
    padding: 0 16px;
  }

  .auth-title {
    font-size: 20px;
  }

  .auth-nav-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .ambient-orb {
    filter: blur(75px);
  }
}
