/**
 * NeedAServer Portal Design Tokens
 * Ready-to-import CSS variables for WHMCS portal and other applications
 * 
 * Usage: @import 'portal-tokens.css';
 * Version: 2.0
 * Last Updated: 2026-01-15
 */

:root {
  /* ============================================================
     BRAND COLORS
     ============================================================ */
  
  --brand-dark-primary: #0B1D33;
  --brand-teal: #23B5AF;
  --brand-charcoal-blue: #1C2430;
  --brand-body-text: #6D7C8A;
  --brand-teal-muted: #64748B;

  /* ============================================================
     TEAL VARIANTS (Use sparingly - ≤5% of visual space)
     ============================================================ */
  
  --teal-primary: #23B5AF;
  --teal-hover: #14B8A6;
  --teal-bright: #2DD4BF;
  --teal-accent: #2FE4C8;
  --teal-secondary: #4FB5BB;
  --teal-soft-bg: rgba(35, 181, 175, 0.08);
  --teal-muted: rgba(45, 212, 191, 0.4);

  /* ============================================================
     NEUTRAL SCALE
     ============================================================ */
  
  --neutral-900: #1F2933;   /* Darkest - headlines, emphasis */
  --neutral-700: #4A5D73;   /* Dark - subheadings */
  --neutral-500: #7A8B9C;   /* Medium - body text muted */
  --neutral-200: #E6EEEE;   /* Light - borders, dividers */
  --neutral-100: #F7FAFA;   /* Lightest - backgrounds */
  --neutral-white: #FFFFFF; /* Pure white */

  /* ============================================================
     BACKGROUNDS (Light Mode)
     ============================================================ */
  
  --bg-page: #FFFFFF;
  --bg-section: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F1F5F9;
  --bg-surface: #FFFFFF;
  --bg-surface-tint: #F0F7F8;

  /* ============================================================
     TEXT COLORS (Light Mode)
     ============================================================ */
  
  --text-primary: #0E1A2B;
  --text-body: #374151;
  --text-muted: #6B7280;
  --text-disabled: #9CA3AF;
  --text-ink: #0E1A2B;       /* Portal specific */
  --text-body-portal: #1E2B3C; /* Portal specific */
  --text-muted-portal: #667788; /* Portal specific */

  /* ============================================================
     BORDERS
     ============================================================ */
  
  --border-subtle: rgba(14, 26, 43, 0.08);
  --border-accent: rgba(45, 212, 191, 0.4);
  --border-default: rgba(14, 26, 43, 0.10);
  --border-hover: rgba(14, 26, 43, 0.20);

  /* ============================================================
     STATUS COLORS
     ============================================================ */
  
  --status-success: #22C55E;
  --status-warning: #F59E0B;
  --status-error: #EF4444;
  --status-info: #38BDF8;
  
  /* Server status */
  --status-active: #22C55E;
  --status-pending: #F59E0B;
  --status-suspended: #EF4444;

  /* ============================================================
     TYPOGRAPHY
     ============================================================ */
  
  /* Font Families */
  --font-heading: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Font Weights */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;
  --weight-black: 900;
  
  /* Font Sizes - Headings */
  --h1-size: 56px;
  --h1-size-mobile: 36px;
  --h2-size: 36px;
  --h2-size-mobile: 28px;
  --h3-size: 24px;
  --h3-size-mobile: 20px;
  --h4-size: 20px;
  
  /* Font Sizes - Body */
  --body-size: 16px;
  --body-small-size: 14px;
  --button-size: 15px;
  --label-size: 13px;
  --label-size-mobile: 12px;
  --eyebrow-size: 12px;
  
  /* Line Heights */
  --line-height-tight: 1.12;
  --line-height-snug: 1.2;
  --line-height-normal: 1.3;
  --line-height-base: 1.4;
  --line-height-relaxed: 1.6;
  
  /* Letter Spacing */
  --letter-spacing-tight: -0.02em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.02em;
  --letter-spacing-wider: 0.08em;
  --letter-spacing-widest: 0.16em;

  /* ============================================================
     SPACING (8px base unit)
     ============================================================ */
  
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;
  --spacing-xxl: 64px;
  --spacing-3xl: 96px;
  
  /* Section Spacing */
  --section-padding-y: 96px;
  --section-padding-y-mobile: 48px;
  --section-padding-x: 120px;
  --section-padding-x-mobile: 24px;
  
  /* Container */
  --container-max-width: 1440px;
  --container-padding: 48px;
  --container-padding-mobile: 24px;

  /* ============================================================
     BORDER RADIUS
     ============================================================ */
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-button: 11px;
  --radius-card: 12px;
  --radius-pill: 999px;

  /* ============================================================
     SHADOWS
     ============================================================ */
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(14, 26, 43, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(14, 26, 43, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(14, 26, 43, 0.1);
  
  /* Card Shadows */
  --shadow-card: 0 1px 3px 0 rgba(14, 26, 43, 0.08);
  --shadow-card-hover: 0 4px 12px 0 rgba(14, 26, 43, 0.12);
  --shadow-card-lift: 0 8px 24px 0 rgba(14, 26, 43, 0.15);
  
  /* Button Shadows */
  --shadow-button-teal: 0 4px 12px rgba(35, 181, 175, 0.25);

  /* ============================================================
     COMPONENT TOKENS - BUTTONS
     ============================================================ */
  
  /* Primary Button */
  --button-primary-bg: #2DD4BF;
  --button-primary-bg-hover: #14B8A6;
  --button-primary-text: #FFFFFF;
  --button-primary-shadow: 0 4px 12px rgba(35, 181, 175, 0.25);
  --button-primary-focus-ring: rgba(45, 212, 191, 0.4);
  --button-primary-radius: 11px;
  --button-primary-padding: 16px 28px;
  --button-primary-height: 52px;
  
  /* Secondary Button */
  --button-secondary-bg: transparent;
  --button-secondary-bg-hover: rgba(45, 212, 191, 0.08);
  --button-secondary-text: #0B1D33;
  --button-secondary-border: 1.5px solid #CBD5E1;
  --button-secondary-border-hover: 1.5px solid #2DD4BF;
  --button-secondary-focus-ring: rgba(45, 212, 191, 0.4);

  /* ============================================================
     COMPONENT TOKENS - CARDS
     ============================================================ */
  
  --card-bg: #FFFFFF;
  --card-bg-hover: #F1F5F9;
  --card-border: rgba(14, 26, 43, 0.08);
  --card-border-hover: rgba(45, 212, 191, 0.4);
  --card-radius: 12px;
  --card-padding: 24px;

  /* ============================================================
     COMPONENT TOKENS - PILLS/LABELS
     ============================================================ */
  
  --pill-bg: rgba(45, 212, 191, 0.08);
  --pill-border: rgba(45, 212, 191, 0.4);
  --pill-text: #2DD4BF;
  --pill-radius: 999px;
  --pill-padding: 6px 14px;

  /* ============================================================
     COMPONENT TOKENS - LINKS
     ============================================================ */
  
  --link-text: #2DD4BF;
  --link-text-hover: #14B8A6;

  /* ============================================================
     GRADIENTS
     ============================================================ */
  
  --gradient-hero-light: linear-gradient(to bottom, #DDE3E6 0%, #F2F5F7 50%, #F2F5F7 100%);
  --gradient-hero-dark: linear-gradient(135deg, #071A2B 0%, #0B2A3A 100%);
  --gradient-subtle-teal: linear-gradient(135deg, rgba(35,181,175,0.08) 0%, rgba(35,181,175,0.04) 100%);
  --gradient-section: linear-gradient(180deg, transparent 0%, #FFFFFF 100%);
  --gradient-overlay-bottom: linear-gradient(to top, rgba(11, 18, 32, 0.28) 0%, transparent 100%);
  --gradient-overlay-top: linear-gradient(to bottom, rgba(11, 18, 32, 0.49) 0%, transparent 100%);
  --gradient-radial-soft: radial-gradient(ellipse 350px 260px at 25% 50%, #F4F7FA 0%, #E9EEF3 100%);
  --gradient-teal-glow: radial-gradient(ellipse 900px 500px at 0% 100%, rgba(35, 181, 175, 0.03) 0%, transparent 65%);

  /* ============================================================
     TRANSITIONS
     ============================================================ */
  
  --transition-fast: 150ms ease-in-out;
  --transition-base: 200ms ease-in-out;
  --transition-slow: 300ms ease-in-out;
}

/* ============================================================
   DARK MODE
   ============================================================ */

[data-theme="dark"],
.dark-mode {
  /* Backgrounds */
  --bg-page: #0B1220;
  --bg-section: #0F172A;
  --bg-card: #111827;
  --bg-card-hover: #162036;
  
  /* Text */
  --text-primary: #E5E7EB;
  --text-body: #CBD5E1;
  --text-muted: #94A3B8;
  --text-disabled: #64748B;
  
  /* Borders */
  --border-subtle: rgba(148, 163, 184, 0.12);
  --border-default: rgba(148, 163, 184, 0.12);
  --border-hover: rgba(148, 163, 184, 0.24);
}

/* ============================================================
   SYSTEM PREFERENCE DETECTION
   ============================================================ */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Backgrounds */
    --bg-page: #0B1220;
    --bg-section: #0F172A;
    --bg-card: #111827;
    --bg-card-hover: #162036;
    
    /* Text */
    --text-primary: #E5E7EB;
    --text-body: #CBD5E1;
    --text-muted: #94A3B8;
    --text-disabled: #64748B;
    
    /* Borders */
    --border-subtle: rgba(148, 163, 184, 0.12);
    --border-default: rgba(148, 163, 184, 0.12);
    --border-hover: rgba(148, 163, 184, 0.24);
  }
}

/* ============================================================
   RESPONSIVE OVERRIDES
   ============================================================ */

@media (max-width: 768px) {
  :root {
    /* Typography */
    --h1-size: var(--h1-size-mobile);
    --h2-size: var(--h2-size-mobile);
    --h3-size: var(--h3-size-mobile);
    --label-size: var(--label-size-mobile);
    
    /* Spacing */
    --section-padding-y: var(--section-padding-y-mobile);
    --section-padding-x: var(--section-padding-x-mobile);
    --container-padding: var(--container-padding-mobile);
  }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.container {
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.section {
  padding-top: var(--section-padding-y);
  padding-bottom: var(--section-padding-y);
  padding-left: var(--section-padding-x);
  padding-right: var(--section-padding-x);
}

.btn-primary {
  background-color: var(--button-primary-bg);
  color: var(--button-primary-text);
  padding: var(--button-primary-padding);
  height: var(--button-primary-height);
  border-radius: var(--button-primary-radius);
  box-shadow: var(--button-primary-shadow);
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  font-size: var(--button-size);
  border: none;
  cursor: pointer;
  transition: var(--transition-base);
}

.btn-primary:hover {
  background-color: var(--button-primary-bg-hover);
}

.btn-secondary {
  background-color: var(--button-secondary-bg);
  color: var(--button-secondary-text);
  padding: var(--button-primary-padding);
  height: var(--button-primary-height);
  border-radius: var(--button-primary-radius);
  border: var(--button-secondary-border);
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  font-size: var(--button-size);
  cursor: pointer;
  transition: var(--transition-base);
}

.btn-secondary:hover {
  background-color: var(--button-secondary-bg-hover);
  border: var(--button-secondary-border-hover);
}

.card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow: var(--shadow-card);
  transition: var(--transition-base);
}

.card:hover {
  background-color: var(--card-bg-hover);
  border-color: var(--card-border-hover);
  box-shadow: var(--shadow-card-hover);
}

.pill {
  background-color: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--pill-text);
  border-radius: var(--pill-radius);
  padding: var(--pill-padding);
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  font-size: var(--label-size);
  display: inline-block;
}

.link {
  color: var(--link-text);
  text-decoration: none;
  transition: var(--transition-fast);
}

.link:hover {
  color: var(--link-text-hover);
  text-decoration: underline;
}

/* ============================================================
   USAGE REMINDER
   ============================================================
   
   ⚠️ TEAL USAGE RULES (CRITICAL):
   
   ✅ USE teal for:
   - Primary CTAs (buttons)
   - Interactive links
   - Icons (interactive states)
   - Pills/labels
   - Highlighted words in headlines (1-2 words max)
   
   ❌ NEVER use teal for:
   - Body text
   - Entire headlines
   - Large background fills
   - Decorative elements
   
   📊 Color Distribution:
   - Neutral backgrounds: 70–80%
   - Text/content: 15–25%
   - Accent (teal): ≤5%
   
   ============================================================ */
