/**
 * AI Coach Pro — Unified Design System
 * =====================================
 * This file is the single source of truth for the entire app's visual identity.
 * Based on the premium planos.php / checkout.php dark theme.
 *
 * Include BEFORE page-specific styles so pages can override tokens if needed.
 * Font import is done here — no need to import Outfit/Space Grotesk elsewhere.
 */

/* ========== FONTS ========== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ========== DESIGN TOKENS ========== */
:root {
  /* Primary — teal */
  --primary: #4fd1c5;
  --primary-dark: #38b2ac;
  --primary-light: #7eeae0;
  --primary-bg: rgba(79, 209, 197, 0.15);

  /* Secondary — green */
  --secondary: #68d391;
  --secondary-dark: #48bb78;
  --secondary-light: #9ae6b4;
  --secondary-bg: rgba(104, 211, 145, 0.15);

  /* Accent — pink */
  --accent: #f687b3;
  --accent-dark: #e76a9f;
  --accent-light: #faa7c9;

  /* Surfaces */
  --bg-dark: #0f0f23;
  --bg-dark-2: #161633;
  --bg-dark-3: #121228;
  --bg-card: rgba(18, 18, 40, 0.6);

  /* Typography */
  --text-light: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #1e293b;

  /* Borders */
  --border-light: rgba(255, 255, 255, 0.1);
  --border-medium: rgba(255, 255, 255, 0.06);

  /* Shadows */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 32px rgba(31, 38, 135, 0.15);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-focus: 0 0 0 3px rgba(79, 209, 197, 0.25);

  /* Gradients */
  --gradient-primary: linear-gradient(90deg, #4fd1c5, #68d391);
  --gradient-body: linear-gradient(135deg, #0a0a1a 0%, #121228 50%, #0d0d1f 100%);

  /* Status */
  --success: #68d391;
  --warning: #f6ad55;
  --danger: #ff5c5c;
  --info: #63b3ed;

  /* Notification colours */
  --notification-success-bg: rgba(61, 203, 184, 0.15);
  --notification-error-bg: rgba(255, 92, 92, 0.15);
  --notification-success-border: rgba(61, 203, 184, 0.5);
  --notification-error-border: rgba(255, 92, 92, 0.5);
  --notification-success-icon: #3dcbb8;
  --notification-error-icon: #ff5c5c;

  /* Misc */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 1.5rem;
  --radius-xl: 24px;
}

/* ========== BASE RESET ========== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gradient-body);
  background-attachment: fixed;
  color: var(--text-light);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  width: 100%;
  max-width: 100vw;
  letter-spacing: -0.01em;
  margin: 0;
  padding: 0;
}

/* ========== BACKGROUND EFFECTS ========== */

/* SVG grid pattern overlay */
.bg-pattern {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%234fd1c5' fill-opacity='0.05'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3Cpath d='M6 5V0H5v5H0v1h5v94h1V6h94V5H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

/* Radial gradient blurs — purple (top-right) and teal (bottom-left) */
.bg-gradient-1 {
  position: fixed;
  top: -10%; right: 0;
  width: 70%; height: 70%;
  background: radial-gradient(circle, rgba(79, 209, 197, 0.1), transparent 70%);
  border-radius: 50%;
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
}

.bg-gradient-2 {
  position: fixed;
  bottom: -10%; left: 0;
  width: 60%; height: 60%;
  background: radial-gradient(circle, rgba(79, 209, 197, 0.08), transparent 70%);
  border-radius: 50%;
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', 'Outfit', sans-serif;
  letter-spacing: -0.02em;
  color: var(--text-light);
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== GLASS CARDS ========== */
.glass-card {
  background: rgba(18, 18, 40, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1),
              box-shadow 0.35s cubic-bezier(0.4,0,0.2,1),
              border-color 0.35s ease;
}

.glass-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ========== RESPONSIVE GLASS SECTIONS ========== */
.glass-section {
  background: rgba(18, 18, 40, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.glass-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, rgba(79,209,197,0.15), rgba(104,211,145,0.12));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.glass-section:hover::before {
  opacity: 1;
}

/* ========== COMMON BUTTONS ========== */
.btn-primary-gradient {
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(79,209,197,0.3);
  color: #fff;
}

.btn-glass {
  background: rgba(79, 209, 197, 0.1);
  color: var(--primary);
  border: 1px solid rgba(79, 209, 197, 0.2);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-glass:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
}

.btn-glass-secondary {
  background: rgba(79, 209, 197, 0.1);
  color: var(--secondary);
  border: 1px solid rgba(79, 209, 197, 0.2);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-glass-secondary:hover {
  background: var(--secondary);
  color: #000;
  border-color: var(--secondary);
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(79,209,197,0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(79,209,197,0.5);
}

/* ========== UTILITY ANIMATIONS ========== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* ========== FORM ELEMENTS ========== */
.form-control-dark {
  background: rgba(15, 15, 35, 0.6);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-light);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control-dark:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
  outline: none;
  background: rgba(15, 15, 35, 0.8);
}

.form-control-dark::placeholder {
  color: rgba(148,163,184,0.5);
}

/* ========== BADGES ========== */
.badge-primary {
  background: var(--primary-bg);
  color: var(--primary);
  border: 1px solid rgba(79,209,197,0.2);
}

.badge-secondary {
  background: var(--secondary-bg);
  color: var(--secondary);
  border: 1px solid rgba(79,209,197,0.2);
}

/* ========== FOOTER ========== */
.footer-unified {
  background: rgba(15,15,35,0.8);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-medium);
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 1.5rem 0;
  text-align: center;
}

.footer-unified .brand-name {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

/* ========== PAGE WRAPPER ========== */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
}

.page-wrapper > main {
  flex: 1;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .glass-card { padding: 1.25rem; }
  .glass-section { padding: 1.5rem; }
}

@media (max-width: 576px) {
  .glass-card { padding: 1rem; }
  .glass-section { padding: 1rem; }
}
