/* ===========================
   ESTILOS GLOBAIS - RISE ENGLISH SCHOOL
   Tema: Roxo, Branco, Preto
   =========================== */

:root {
  --primary: #8B5CF6;
  --primary-light: #A78BFA;
  --primary-lighter: rgba(139, 92, 246, 0.16);
  --primary-dark: #6D28D9;
  --secondary: #1F2937;
  --secondary-dark: #070B16;
  --white: #FFFFFF;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --site-bg: #060A14;
  --site-bg-soft: #0B1020;
  --surface: rgba(15, 23, 42, 0.78);
  --surface-strong: rgba(8, 13, 28, 0.94);
  --surface-muted: rgba(139, 92, 246, 0.08);
  --border-soft: rgba(167, 139, 250, 0.22);
  --text-main: #F8FAFC;
  --text-muted: #CBD5E1;
  --error: #EF4444;
  --success: #10B981;
  --warning: #F59E0B;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    linear-gradient(180deg, rgba(6, 10, 20, 0.96), rgba(8, 12, 24, 0.98)),
    var(--site-bg);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* TIPOGRAFIA */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 4rem;
}

h2 {
  font-size: 2.6rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-light);
}

/* BOTÕES */

.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(139, 92, 246, 0.32);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(139, 92, 246, 0.42);
  color: #ffffff;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  border: 2px solid rgba(167, 139, 250, 0.62);
}

.btn-secondary:hover {
  background-color: rgba(139, 92, 246, 0.14);
  border-color: var(--primary-light);
  color: #ffffff;
}

.btn-dark {
  background-color: var(--surface-strong);
  color: #ffffff;
}

.btn-dark:hover {
  background-color: #111827;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-block {
  width: 100%;
}

.btn-logout {
  background-color: var(--error);
  color: var(--white);
  border: none;
}

.btn-logout:hover {
  background-color: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px rgba(239, 68, 68, 0.35);
}

.btn-logout:active {
  transform: translateY(0);
}

/* CONTAINER */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-sm {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* HEADER / NAVBAR */

header {
  background: rgba(6, 10, 20, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: none;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.brand-logo {
  display: block;
  height: 64px;
  max-width: 180px;
  object-fit: contain;
  width: auto;
  filter: drop-shadow(0 0 16px rgba(139, 92, 246, 0.28));
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: rgba(248, 250, 252, 0.78);
  font-weight: 700;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-auth {
  display: flex;
  gap: 1rem;
}

/* FOOTER */

footer {
  background:
    linear-gradient(180deg, rgba(10, 15, 30, 0.94), rgba(4, 7, 14, 0.98));
  color: #ffffff;
  border-top: 1px solid var(--border-soft);
  padding: 3rem 0 2rem;
  margin-top: 0;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: var(--white);
  margin-bottom: 1rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: var(--gray-300);
}

.footer-section a:hover {
  color: var(--primary-light);
}

.footer-bottom {
  border-top: 1px solid var(--gray-500);
  padding-top: 1.5rem;
  text-align: center;
  color: var(--gray-400);
}

/* CARDS */

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.card:hover {
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.3);
  border-color: var(--primary);
}

.card-featured {
  border: 2px solid var(--primary);
  box-shadow: 0 20px 40px rgba(124, 58, 237, 0.15);
}

/* FORM */

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-main);
}

input, textarea, select {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid #9167f6;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #C4B5FD 50%),
    linear-gradient(135deg, #C4B5FD 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
  color-scheme: dark;
  cursor: pointer;
  padding-right: 2.7rem;
}

select option,
select optgroup {
  background: #0F172A;
  color: #F8FAFC;
}

select option:checked,
select option:hover {
  background: #7C3AED;
  color: #FFFFFF;
}

select option:disabled {
  background: #111827;
  color: #94A3B8;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.18);
}

input::placeholder {
  color: rgba(203, 213, 225, 0.58);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.form-error {
  display: block;
  color: var(--error);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* ALERT */

.alert {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.alert-info {
  background-color: rgba(124, 58, 237, 0.1);
  border-left: 4px solid var(--primary);
  color: var(--text-main);
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.1);
  border-left: 4px solid var(--success);
  color: var(--text-main);
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.1);
  border-left: 4px solid var(--error);
  color: var(--error);
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.1);
  border-left: 4px solid #f59e0b;
  color: #92400e;
}

/* GRID */

.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* SPACING UTILITIES */

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-muted { color: var(--gray-500); }
.text-error { color: var(--error); }
.text-success { color: var(--success); }

.hidden { display: none !important; }
.visible { display: block !important; }

/* RESPONSIVO */

@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .navbar .nav-links {
    display: none;
  }

  .navbar .nav-auth .btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }
}

/* LOADING SPINNER */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* TRANSITIONS */

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.whatsapp-float {
  align-items: center;
  background: #25d366;
  border-radius: 50px;
  bottom: 24px;
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.4);
  color: white;
  cursor: pointer;
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  position: fixed;
  right: 24px;
  text-decoration: none;
  z-index: 9000;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-weight: 800;
}
.whatsapp-float:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.5);
}
.whatsapp-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.whatsapp-label {
  font-weight: 700;
  font-size: 0.9rem;
}

/* THEME: Dark mode variables (toggle by adding class "dark" to <html>) */
.dark {
    --white: #000000;
    --gray-50: #0a0f1f;
    --gray-100: #4b6db1;
    --gray-200: #8c5ef6;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-600: #4B5563;
    --secondary: #1F2937;
    --secondary-dark: #070B16;
    --primary: #8b5cf6;
    --primary-light: #a78bfa;
    --primary-lighter: rgba(139, 92, 246, 0.16);
}

/* Small adjustments for dark mode elements */
.dark body {
  background-color: var(--gray-100);
  color: var(--text-main);
}
.dark header, .dark .card, .dark .settings-card, .dark .table-container {
  background: rgba(8, 13, 28, 0.92);
  border-color: var(--border-soft);
}
.dark a { color: var(--primary-light); }
.dark .btn-primary,
.dark .btn-dark,
.dark .btn-logout {
  color: #ffffff;
}
.dark .btn-secondary {
  background-color: transparent;
  color: var(--primary-light);
}
