/*!
 * Legado das Competições — Design System de Autenticação (auth.css)
 * Profissional, responsivo, mobile-first, suporte a dark/light mode.
 * Otimizado para Smartphone, Tablet, Notebook, Desktop e Smart TV.
 */

:root {
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Cores de Marca Senac / Legado */
  --legado-blue: #2E5BFF;
  --legado-blue-hover: #1E46D9;
  --legado-blue-glow: rgba(46, 91, 255, 0.35);
  --legado-green: #10B981;
  --legado-green-hover: #059669;
  --legado-amber: #F59E0B;
  --legado-purple: #8B5CF6;

  /* Tema Escuro (Padrão Profissional) */
  --bg-body: #080D1A;
  --bg-gradient: radial-gradient(circle at 15% 15%, rgba(46, 91, 255, 0.15) 0%, transparent 45%),
                 radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.12) 0%, transparent 45%),
                 #080D1A;
  --bg-card: rgba(19, 28, 48, 0.82);
  --bg-card-solid: #131C30;
  --bg-input: rgba(10, 16, 30, 0.75);
  --bg-input-focus: rgba(15, 23, 42, 0.95);
  
  --border-card: rgba(255, 255, 255, 0.1);
  --border-card-hover: rgba(46, 91, 255, 0.5);
  --border-input: rgba(255, 255, 255, 0.14);
  --border-input-focus: #2E5BFF;
  
  --text-main: #FFFFFF;
  --text-muted: #94A3B8;
  --text-sub: #CBD5E1;

  --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-input-focus: 0 0 0 3px rgba(46, 91, 255, 0.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 9999px;

  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-body: #F4F6FC;
  --bg-gradient: radial-gradient(circle at 10% 10%, rgba(46, 91, 255, 0.08) 0%, transparent 40%),
                 radial-gradient(circle at 90% 90%, rgba(16, 185, 129, 0.06) 0%, transparent 40%),
                 #F4F6FC;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-solid: #FFFFFF;
  --bg-input: #F8FAFC;
  --bg-input-focus: #FFFFFF;
  
  --border-card: #E2E8F0;
  --border-card-hover: #2E5BFF;
  --border-input: #CBD5E1;
  --border-input-focus: #2E5BFF;
  
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-sub: #334155;

  --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
  --shadow-input-focus: 0 0 0 3px rgba(46, 91, 255, 0.2);
}

/* Reset Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body.auth-page {
  font-family: var(--font-family);
  background: var(--bg-body);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
  padding: 1rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* Grid sutil decorativo de fundo */
.auth-bg-grid {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}
[data-theme="light"] .auth-bg-grid {
  background-image: radial-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px);
}

/* Orbs de luz ambiente */
.auth-ambient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}
.orb--1 {
  width: 380px; height: 380px;
  background: rgba(46, 91, 255, 0.22);
  top: -80px; left: -80px;
}
.orb--2 {
  width: 320px; height: 320px;
  background: rgba(16, 185, 129, 0.16);
  bottom: -60px; right: -60px;
}

/* Botão Flutuante de Alternância de Tema */
.auth-theme-switch {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  z-index: 50;
  width: 44px; height: 44px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.auth-theme-switch:hover {
  transform: translateY(-2px);
  border-color: var(--legado-blue);
  color: var(--legado-blue);
}

/* Layout Principal de Autenticação */
.auth-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1140px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  justify-content: center;
}

/* Painel Esquerdo: Brand Showcase */
.auth-brand-side {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.auth-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.auth-brand-logo svg {
  width: 44px; height: 44px;
  flex-shrink: 0;
}
.auth-brand-logo-text {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-main);
}
.auth-brand-logo-text span {
  color: var(--legado-blue);
}

.auth-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-pill);
  background: rgba(46, 91, 255, 0.12);
  border: 1px solid rgba(46, 91, 255, 0.3);
  font-size: 0.78rem;
  font-weight: 700;
  color: #60A5FA;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.auth-brand-heading {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.auth-brand-lead {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Cards de Benefícios/Features do Brand Side */
.auth-brand-features {
  display: none; /* Mobile padrão esconde p/ focar no login; visível em desktop */
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  margin-top: 0.5rem;
}

.auth-feature-pill {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(8px);
  text-align: left;
  transition: var(--transition);
}
.auth-feature-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(46, 91, 255, 0.4);
  transform: translateX(4px);
}
.auth-feature-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.icon--blue { background: rgba(46, 91, 255, 0.15); color: #60A5FA; }
.icon--emerald { background: rgba(16, 185, 129, 0.15); color: #34D399; }
.icon--amber { background: rgba(245, 158, 11, 0.15); color: #FBBF24; }

.auth-feature-text h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}
.auth-feature-text p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* Painel Direito: Cartão de Autenticação */
.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 2.25rem 1.75rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.auth-card__header {
  text-align: center;
  margin-bottom: 1.6rem;
}
.auth-card__title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}
.auth-card__subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Abas de Segmento (Equipe Senac / Sou Aluno) */
.auth-segmented-control {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin-bottom: 1.5rem;
  position: relative;
}
.auth-segment-btn {
  flex: 1;
  border: none;
  background: none;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.auth-segment-btn.is-active {
  background: var(--legado-blue);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(46, 91, 255, 0.35);
}
.auth-segment-btn:focus-visible {
  outline: 2px solid var(--legado-blue);
  outline-offset: 2px;
}

/* Mensagens de Alerta */
.auth-alert-box {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  line-height: 1.4;
  animation: fadeIn 0.2s ease-out;
}
.auth-alert--danger {
  background: rgba(225, 29, 72, 0.12);
  border: 1px solid rgba(225, 29, 72, 0.35);
  color: #FB7185;
}

/* Grupos de Campos de Formulário */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  text-align: left;
}
.form-field label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-sub);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-icon .field-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.input-with-icon input {
  width: 100%;
  height: 48px;
  padding: 0 2.85rem 0 2.85rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border-input);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}
.input-with-icon input:focus {
  background: var(--bg-input-focus);
  border-color: var(--border-input-focus);
  box-shadow: var(--shadow-input-focus);
}
.input-with-icon input:focus ~ .field-icon {
  color: var(--legado-blue);
}

/* Botão Ver/Ocultar Senha */
.btn-toggle-password {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.btn-toggle-password:hover {
  color: var(--text-main);
}

/* Botões Principais */
.btn-submit {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2E5BFF 0%, #1A44ED 100%);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(46, 91, 255, 0.4);
  margin-top: 0.35rem;
}
.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(46, 91, 255, 0.5);
  background: linear-gradient(135deg, #3A66FF 0%, #204BF0 100%);
}
.btn-submit:active {
  transform: translateY(0);
}
.btn-submit--aluno {
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}
.btn-submit--aluno:hover {
  background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.5);
}

/* Atalhos de Credenciais para Teste Rápido */
.auth-demo-pills {
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-card);
  border-radius: var(--radius-md);
  text-align: left;
}
.auth-demo-pills-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.auth-demo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.demo-tag {
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 600;
  background: rgba(46, 91, 255, 0.12);
  color: #93C5FD;
  border: 1px solid rgba(46, 91, 255, 0.25);
  cursor: pointer;
  transition: var(--transition);
}
.demo-tag:hover {
  background: var(--legado-blue);
  color: #FFFFFF;
  border-color: var(--legado-blue);
}

/* Caixa de Acesso Público de Visitante */
.auth-visitor-card {
  margin-top: 1.5rem;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-lg);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  text-align: center;
  transition: var(--transition);
}
.auth-visitor-card:hover {
  border-color: rgba(16, 185, 129, 0.45);
}
.auth-visitor-card-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #34D399;
  margin-bottom: 0.3rem;
}
.auth-visitor-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.85rem;
}
.btn-visitor-access {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 42px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  background: #10B981;
  color: #FFFFFF;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-visitor-access:hover {
  background: #059669;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* =====================================================================
 * BREAKPOINTS (Conforme tokens autorizados no projeto)
 * 30rem (480px), 40rem (640px), 48rem (768px), 64rem (1024px), 80rem (1280px)
 * ===================================================================== */

/* Smartphone Médio a Tablet Compacto (480px+) */
@media (min-width: 30rem) {
  .auth-card {
    padding: 2.5rem 2.25rem;
  }
}

/* Tablet (640px+) */
@media (min-width: 40rem) {
  .auth-brand-heading {
    font-size: 2rem;
  }
  .auth-brand-features {
    display: flex;
  }
}

/* Tablet Paisagem / Desktop Compacto (768px+) */
@media (min-width: 48rem) {
  .auth-wrapper {
    gap: 2.5rem;
  }
}

/* Notebook / Laptop / Desktop (1024px+ / 64rem) - Layout Split Lado a Lado */
@media (min-width: 64rem) {
  .auth-wrapper {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
  }

  .auth-brand-side {
    max-width: 520px;
    align-items: flex-start;
    text-align: left;
    gap: 1.5rem;
  }

  .auth-brand-heading {
    font-size: 2.35rem;
    line-height: 1.2;
  }

  .auth-brand-lead {
    font-size: 1.05rem;
  }

  .auth-card {
    max-width: 460px;
    padding: 2.75rem 2.5rem;
  }
}

/* Monitores Amplos / Smart TVs 1080p e 4K (1280px+ / 80rem) */
@media (min-width: 80rem) {
  .auth-wrapper {
    max-width: 1240px;
    gap: 6rem;
  }

  .auth-brand-side {
    max-width: 580px;
  }

  .auth-brand-heading {
    font-size: 2.75rem;
  }

  .auth-card {
    max-width: 500px;
  }

  /* Smart TV Ergonomics: Foco aprimorado para controle remoto / teclado */
  a:focus-visible,
  button:focus-visible,
  input:focus-visible {
    outline: 3px solid #60A5FA;
    outline-offset: 3px;
  }
}

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