@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Alexandria:wght@400;600;700&display=swap');

:root {
  --primary: #cd2653;
  --primary-hover: #b81440;
  --primary-light: #fff1f4;
  --primary-glow: rgba(205, 38, 83, 0.2);
  
  --dark-bg: #0d0f14;
  --dark-surface: #151821;
  --dark-border: #262b3a;
  --dark-text: #f3f4f6;
  --dark-muted: #9ca3af;

  --light-bg: #f8f9fa;
  --light-surface: #ffffff;
  --light-border: #e2e8f0;
  --light-text: #1e293b;
  --light-muted: #64748b;

  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-blue: #3b82f6;
  --accent-red: #ef4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 20px var(--primary-glow);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--light-bg);
  color: var(--light-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Belt badges for Judo */
.belt-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.belt-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.2);
}
.belt-branca { background: #f8fafc; color: #334155; border: 1px solid #cbd5e1; }
.belt-branca .belt-dot { background: #ffffff; }
.belt-cinza { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.belt-cinza .belt-dot { background: #94a3b8; }
.belt-azul { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.belt-azul .belt-dot { background: #2563eb; }
.belt-amarela { background: #fefce8; color: #854d0e; border: 1px solid #fef08a; }
.belt-amarela .belt-dot { background: #eab308; }
.belt-laranja { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.belt-laranja .belt-dot { background: #ea580c; }
.belt-verde { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.belt-verde .belt-dot { background: #16a34a; }
.belt-roxa { background: #faf5ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.belt-roxa .belt-dot { background: #9333ea; }
.belt-marrom { background: #fdf8f6; color: #78350f; border: 1px solid #fed7aa; }
.belt-marrom .belt-dot { background: #854d0e; }
.belt-preta { background: #18181b; color: #f4f4f5; border: 1px solid #27272a; }
.belt-preta .belt-dot { background: #cd2653; }

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.status-novo { background: #fee2e2; color: #b91c1c; }
.status-contatado { background: #e0f2fe; color: #0369a1; }
.status-aula_agendada { background: #fef3c7; color: #b45309; }
.status-compareceu { background: #dcfce7; color: #15803d; }
.status-faltou { background: #f1f5f9; color: #64748b; }
.status-matriculado { background: #dbeafe; color: #1d4ed8; }
.status-desistiu { background: #fee2e2; color: #991b1b; }
.status-ativo { background: #dcfce7; color: #15803d; }
.status-trancado { background: #fef3c7; color: #b45309; }
.status-cancelado { background: #f1f5f9; color: #64748b; }
.status-pago { background: #dcfce7; color: #15803d; }
.status-pendente { background: #fef3c7; color: #b45309; }
.status-atrasado { background: #fee2e2; color: #dc2626; font-weight: 700; }

/* Common Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 10px var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px var(--primary-glow);
}
.btn-secondary {
  background: #ffffff;
  color: var(--light-text);
  border: 1px solid var(--light-border);
}
.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.btn-whatsapp {
  background: #25d366;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.25);
}
.btn-whatsapp:hover {
  background: #20ba5a;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(37, 211, 102, 0.35);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}
.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: #334155;
}
.form-label .req {
  color: var(--primary);
}
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--light-border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background-color: #ffffff;
  color: var(--light-text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-backdrop.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
#modalEditarAluno, #modalLancarMensalidade, #modalEvoluir {
  z-index: 10010;
}
.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.25s ease;
}
.modal-backdrop.active .modal-card {
  transform: translateY(0) scale(1);
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--light-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--light-text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-body {
  padding: 24px;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--light-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Agenda & Calendário */
.agenda-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  padding: 20px;
}
@media (max-width: 900px) {
  .agenda-layout {
    grid-template-columns: 1fr !important;
  }
}
.calendar-day-cell {
  min-height: 58px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.15s ease;
  user-select: none;
}
.calendar-day-cell:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.calendar-day-cell.other-month {
  opacity: 0.35;
}
.calendar-day-cell.today {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
}
.calendar-day-cell.today .cell-day-number {
  color: var(--primary);
  font-weight: 800;
}
.calendar-day-cell.selected {
  border: 2px solid var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.calendar-day-cell.has-events {
  background: #ffffff;
  border-color: #a5b4fc;
}
.cell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cell-day-number {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}
.calendar-event-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 4px;
  background: #e0e7ff;
  color: #3730a3;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.agenda-card-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.agenda-card-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

/* Responsive utilities & Mobile-First Foundation */
@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: block !important;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
  }

  /* Previne zoom automático invasivo no iOS Safari (font-size mínimo 16px) */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
    min-height: 46px;
  }

  /* Touch targets amplos padrão Apple HIG / Material Design */
  button, 
  .btn,
  a.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
  }

  /* Scroll horizontal suave para abas/filtros no mobile */
  .mobile-scroll-x {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 8px;
    padding-bottom: 6px;
  }
  .mobile-scroll-x::-webkit-scrollbar {
    display: none !important;
  }

  /* Bottom Sheets para Modais no Mobile */
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .modal-dialog {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh !important;
    border-radius: 20px 20px 0 0 !important;
    margin: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 16px)) !important;
    animation: slideUpSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  @keyframes slideUpSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  /* Drag handle visual de Bottom Sheet */
  .bottom-sheet-handle {
    width: 42px;
    height: 5px;
    background: #cbd5e1;
    border-radius: 99px;
    margin: 10px auto 14px;
    display: block !important;
  }
}

