/* =====================================================================
   css/style_global.css — Variáveis e estilos base do projeto
   Peasy Pedidos — Tema: Preto + Verde Neon
   =====================================================================
   COMO USAR:
   Em todas as páginas do projeto, coloque no <head>:
     <link rel="stylesheet" href="css/style_global.css">
   (ajuste o caminho conforme a profundidade da pasta)
   ===================================================================== */


/* =====================================================================
   VARIÁVEIS GLOBAIS (Design Tokens)
   Tudo que é cor, sombra ou glow fica aqui.
   Assim pra mudar uma cor, muda em 1 lugar e aplica em tudo.
   ===================================================================== */
:root {

  /* --- CORES PRIMÁRIAS (verde neon) --- */
  --primary:        #00FF88;   /* verde neon principal */
  --primary-dark:   #00CC6A;   /* verde mais escuro (hover de botões) */
  --primary-light:  #66FFB8;   /* verde mais claro (destaques sutis) */

  /* --- FUNDOS (preto) --- */
  --bg:             #000000;   /* fundo da página */
  --bg-secondary:   #0A0A0A;   /* fundo levemente mais claro */
  --bg-card:        #111111;   /* fundo de cards e inputs */
  --bg-card-hover:  #1A1A1A;   /* fundo do card quando passa o mouse */

  /* --- TEXTOS --- */
  --text:           #FFFFFF;   /* texto principal */
  --text-muted:     #B0B0B0;   /* texto secundário / labels */
  --text-disabled:  #555555;   /* texto desabilitado */

  /* --- BORDAS --- */
  --border:         #333333;          /* borda padrão */
  --border-neon:    rgba(0,255,136,0.3); /* borda verde sutil (inputs, cards) */
  --border-neon-strong: rgba(0,255,136,0.6); /* borda verde mais forte (focus) */

  /* --- SOMBRAS E GLOW --- */
  --shadow-sm:  0 4px 12px rgba(0, 255, 136, 0.10);
  --shadow-md:  0 8px 24px rgba(0, 255, 136, 0.20);
  --shadow-lg:  0 16px 40px rgba(0, 255, 136, 0.25);
  --glow-sm:    0 0 12px rgba(0, 255, 136, 0.25);
  --glow-md:    0 0 20px rgba(0, 255, 136, 0.35);
  --glow-lg:    0 0 40px rgba(0, 255, 136, 0.45);

  /* --- ESTADOS SEMÂNTICOS --- */
  --success:  #00FF88;   /* mesmo que primary (verde) */
  --danger:   #FF4D4D;   /* vermelho pra erros */
  --warning:  #FFB800;   /* amarelo pra alertas */
  --info:     #4facfe;   /* azul pra informações */

  /* --- OUTROS --- */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


/* =====================================================================
   RESET E BASE
   ===================================================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  /* Tamanho da fonte base (16px) — nunca mexa nisso */
  font-size: 16px;
  /* Scroll suave ao navegar entre âncoras */
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-secondary) 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  /* Evita scroll horizontal indesejado no mobile */
  overflow-x: hidden;
}


/* =====================================================================
   TIPOGRAFIA
   ===================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

p {
  color: var(--text-muted);
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-light);
  text-shadow: 0 0 8px rgba(0,255,136,0.4);
}

/* Título de página com sublinhado neon */
.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.page-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  box-shadow: var(--glow-sm);
}


/* =====================================================================
   BOTÕES
   ===================================================================== */

/* Botão primário (verde neon com texto preto — mais legível) */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;                     /* MOBILE FIRST: 48px pra toque confortável */
  padding: 0 24px;
  background: var(--primary);
  color: #000000;                   /* PRETO no texto (contraste máximo) */
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-light);
  box-shadow: var(--shadow-md), var(--glow-md);
  transform: translateY(-2px);
  color: #000000;
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Botão outline (bordas neon, fundo transparente) */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  background: rgba(0, 255, 136, 0.08);
  color: var(--primary);
  border: 1px solid var(--border-neon);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-outline:hover:not(:disabled) {
  background: rgba(0, 255, 136, 0.15);
  border-color: var(--primary);
  box-shadow: var(--glow-sm);
  color: var(--primary);
}

/* Botão de perigo (delete, cancelar) */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  background: rgba(255, 77, 77, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 77, 77, 0.3);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(255, 77, 77, 0.2);
  border-color: var(--danger);
  box-shadow: 0 0 16px rgba(255,77,77,0.3);
}

/* Botão pequeno (tabelas, ações rápidas) */
.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

/* Botão full width */
.btn-block { width: 100%; }


/* =====================================================================
   INPUTS E FORMULÁRIOS
   ===================================================================== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Wrapper pra inputs com ícone */
.input-wrapper {
  position: relative;
}

.input-wrapper > i:first-child {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-disabled);
  font-size: 16px;
  pointer-events: none;
  transition: color 0.2s;
}

/* MOBILE FIRST: font-size: 16px OBRIGATÓRIO — evita zoom automático no iPhone */
.form-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-size: 16px;
  font-family: inherit;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  transition: var(--transition);
  outline: none;
}

/* Com ícone à esquerda */
.input-wrapper .form-input {
  padding-left: 44px;
}

.form-input::placeholder {
  color: var(--text-disabled);
}

.form-input:focus {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 3px rgba(0,255,136,0.12), var(--glow-sm);
}

.form-input:focus + i,
.input-wrapper:focus-within > i:first-child {
  color: var(--primary);
}

/* Textarea */
textarea.form-input {
  height: auto;
  min-height: 100px;
  padding-top: 12px;
  padding-bottom: 12px;
  resize: vertical;
}

/* Select */
select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300FF88' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}


/* =====================================================================
   CARDS
   ===================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

/* Efeito de scan horizontal ao hover (marca registrada do projeto) */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0,255,136,0.06), transparent);
  transition: left 0.6s ease;
  pointer-events: none;
}

.card:hover {
  border-color: var(--border-neon);
  box-shadow: var(--shadow-md), var(--glow-sm);
  background: var(--bg-card-hover);
}

.card:hover::before {
  left: 100%;
}


/* =====================================================================
   ALERTAS / MENSAGENS
   ===================================================================== */
.alert {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 16px;
  animation: slideDown 0.3s ease;
}

.alert.show { display: flex; }

.alert-error {
  background: rgba(255, 77, 77, 0.1);
  color: #FF8080;
  border: 1px solid rgba(255, 77, 77, 0.3);
}

.alert-success {
  background: rgba(0, 255, 136, 0.1);
  color: var(--primary);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.alert-warning {
  background: rgba(255, 184, 0, 0.1);
  color: var(--warning);
  border: 1px solid rgba(255, 184, 0, 0.3);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* =====================================================================
   HEADER PADRÃO
   ===================================================================== */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-neon);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}

.header-logo {
  height: 40px;
  object-fit: contain;
}

.app-title-header {
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--info));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* =====================================================================
   FOOTER PADRÃO
   ===================================================================== */
.app-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  text-align: center;
  z-index: 90;
}

.app-footer p {
  font-size: 12px;
  color: var(--text-disabled);
  margin-bottom: 2px;
}

.app-footer a {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}


/* =====================================================================
   SCROLLBAR PERSONALIZADA (padrão do projeto)
   ===================================================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }


/* =====================================================================
   SPINNER DE CARREGAMENTO
   ===================================================================== */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: none;
}

.btn-primary.loading .spinner { display: block; }
.btn-primary.loading .btn-text { display: none; }

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* =====================================================================
   ANIMAÇÕES UTILITÁRIAS
   ===================================================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-neon {
  0%, 100% { box-shadow: var(--glow-sm); }
  50%       { box-shadow: var(--glow-lg); }
}


/* =====================================================================
   UTILITÁRIOS
   ===================================================================== */

/* Esconde visualmente mas mantém pra leitores de tela */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Badges de status */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success { background: rgba(0,255,136,0.15); color: var(--primary); border: 1px solid rgba(0,255,136,0.3); }
.badge-danger  { background: rgba(255,77,77,0.15);  color: var(--danger);  border: 1px solid rgba(255,77,77,0.3); }
.badge-warning { background: rgba(255,184,0,0.15);  color: var(--warning); border: 1px solid rgba(255,184,0,0.3); }
.badge-info    { background: rgba(79,172,254,0.15); color: var(--info);    border: 1px solid rgba(79,172,254,0.3); }