/* =========================================
   ERS CLIENT PORTAL - Stylesheet
   portal.ers.ai
   ========================================= */

/* CSS Variables (matching www.ers.ai) */
:root {
  /* Primary Colors */
  --navy-900: #0D1B2A;
  --navy-800: #1A365D;
  --navy-700: #234876;
  --navy-600: #2C5A8F;
  --navy-100: #E0E7FF;
  --navy-50: #EEF2FF;

  /* Accent Colors */
  --teal-600: #0D9488;
  --teal-500: #14B8A6;
  --teal-400: #2DD4BF;
  --teal-200: #99F6E4;
  --teal-100: #CCFBF1;
  --teal-50: #F0FDFA;

  /* Gold Accent */
  --gold-600: #D97706;
  --gold-500: #D4AF37;
  --gold-400: #E5C158;
  --gold-100: #FEF3C7;

  /* Neutrals */
  --slate-900: #0F172A;
  --slate-800: #1E293B;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748B;
  --slate-400: #94A3B8;
  --slate-300: #CBD5E1;
  --slate-200: #E2E8F0;
  --slate-100: #F1F5F9;
  --slate-50: #F8FAFC;

  /* Status Colors */
  --green-600: #059669;
  --green-500: #10B981;
  --red-600: #DC2626;
  --red-500: #EF4444;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-hero: 'Oswald', sans-serif;
  --font-heading: 'Source Sans Pro', -apple-system, sans-serif;
  --font-body: 'Source Sans Pro', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--slate-700);
  background-color: var(--slate-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy-800);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

@media (min-width: 768px) {
  h1 { font-size: 3.5rem; }
  h2 { font-size: 2.5rem; }
  h3 { font-size: 1.75rem; }
}

p {
  margin-bottom: var(--space-md);
}

.text-lead {
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--slate-600);
}

/* Layout */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 60px;
}

@media (max-width: 767px) {
  .container {
    padding: 0 20px;
  }
}

.section {
  padding: var(--space-4xl) 0;
}

/* =========================================
   HEADER & NAVIGATION
   ========================================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--slate-200);
  transition: all var(--transition-base);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo img {
  height: 52px;
  width: auto;
}

.nav {
  display: none;
}

@media (min-width: 1024px) {
  .nav {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
  }
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--slate-600);
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--navy-800);
}

.nav-link.active {
  color: var(--teal-600);
  font-weight: 600;
}

.nav-cta {
  display: none;
}

@media (min-width: 1024px) {
  .nav-cta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
  }
}

/* Mobile menu */
.mobile-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  background: none;
  border: none;
  cursor: pointer;
}

@media (min-width: 1024px) {
  .mobile-toggle {
    display: none;
  }
}

.mobile-toggle span {
  width: 24px;
  height: 2px;
  background: var(--navy-800);
  transition: all var(--transition-fast);
}

.mobile-menu {
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  padding: var(--space-xl);
  display: none;
  flex-direction: column;
  gap: var(--space-lg);
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu a {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--slate-700);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--slate-200);
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--navy-800);
  color: white;
  border-color: var(--navy-800);
}

.btn-primary:hover {
  background: var(--navy-700);
  border-color: var(--navy-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-teal {
  background: var(--teal-600);
  color: white;
  border-color: var(--teal-600);
}

.btn-teal:hover {
  background: var(--teal-500);
  border-color: var(--teal-500);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--navy-800);
  border-color: var(--navy-800);
}

.btn-secondary:hover {
  background: var(--navy-800);
  color: white;
}

.btn-outline-white {
  background: transparent;
  color: white;
  border-color: white;
}

.btn-outline-white:hover {
  background: white;
  color: var(--navy-800);
}

.btn-ghost {
  background: transparent;
  color: var(--slate-600);
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--navy-800);
  background: var(--slate-100);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* =========================================
   HERO SECTION (Portal Landing)
   ========================================= */
.hero {
  position: relative;
  padding: 140px 0 var(--space-4xl);
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 50%, var(--navy-700) 100%);
  color: white;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--teal-400);
  margin-bottom: var(--space-xl);
  backdrop-filter: blur(10px);
}

.hero-title {
  font-family: var(--font-hero);
  font-size: 2.75rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: white;
  margin-bottom: var(--space-lg);
}

@media (min-width: 768px) {
  .hero-title { font-size: 3.5rem; }
}

@media (min-width: 1024px) {
  .hero-title { font-size: 4rem; }
}

.hero-title .highlight {
  color: var(--teal-400);
}

.hero-subtitle {
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--slate-300);
  margin-bottom: var(--space-2xl);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

/* =========================================
   LOGIN PAGE
   ========================================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 50%, var(--navy-700) 100%);
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: var(--space-3xl);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
}

.login-logo {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.login-logo img {
  height: 48px;
  margin: 0 auto;
}

.login-title {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-xs);
}

.login-subtitle {
  text-align: center;
  color: var(--slate-500);
  font-size: 0.9375rem;
  margin-bottom: var(--space-2xl);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: var(--space-xs);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--slate-700);
  background: var(--slate-50);
  border: 1px solid var(--slate-300);
  border-radius: 6px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.form-input::placeholder {
  color: var(--slate-400);
}

.login-btn {
  width: 100%;
  padding: 0.875rem;
  font-size: 1rem;
}

.login-error {
  display: none;
  background: var(--red-500);
  color: white;
  padding: var(--space-sm) var(--space-md);
  border-radius: 6px;
  font-size: 0.875rem;
  margin-bottom: var(--space-lg);
  text-align: center;
}

.login-error.visible {
  display: block;
}

.login-footer {
  text-align: center;
  margin-top: var(--space-xl);
  font-size: 0.8125rem;
  color: var(--slate-500);
}

.login-footer a {
  color: var(--teal-600);
  font-weight: 500;
}

.login-footer a:hover {
  color: var(--teal-500);
}

/* =========================================
   DASHBOARD
   ========================================= */
.dashboard-header {
  background: white;
  border-bottom: 1px solid var(--slate-200);
  padding: var(--space-lg) 0;
  margin-top: 80px;
}

.dashboard-welcome {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--navy-800);
}

.dashboard-welcome span {
  color: var(--teal-600);
}

.tools-section {
  padding: var(--space-3xl) 0;
}

.tools-section h2 {
  margin-bottom: var(--space-md);
}

.tools-section .text-lead {
  margin-bottom: var(--space-2xl);
}

.tools-grid {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 768px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tool-card {
  background: white;
  border-radius: 12px;
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-200);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--teal-500);
}

.tool-card-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--teal-500), var(--teal-600));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
  color: white;
  font-size: 1.5rem;
}

.tool-card h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.tool-card p {
  color: var(--slate-600);
  font-size: 0.9375rem;
  margin-bottom: var(--space-lg);
  flex: 1;
}

.tool-card .btn {
  align-self: flex-start;
}

.tool-card-locked {
  opacity: 0.6;
  pointer-events: none;
}

.tool-card-locked .tool-card-icon {
  background: linear-gradient(135deg, var(--slate-400), var(--slate-500));
}

.tool-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 100px;
  margin-bottom: var(--space-md);
}

.tool-badge-active {
  background: var(--teal-100);
  color: var(--teal-600);
}

.tool-badge-coming {
  background: var(--slate-100);
  color: var(--slate-500);
}

/* =========================================
   PROFIT MAP TOOL PAGE
   ========================================= */
.tool-page {
  margin-top: 80px;
  min-height: calc(100vh - 80px);
}

.tool-page-header {
  background: white;
  border-bottom: 1px solid var(--slate-200);
  padding: var(--space-xl) 0;
}

.tool-page-header h1 {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
}

.tool-page-header p {
  color: var(--slate-600);
  margin-bottom: 0;
}

.tool-breadcrumb {
  font-size: 0.875rem;
  color: var(--slate-500);
  margin-bottom: var(--space-md);
}

.tool-breadcrumb a {
  color: var(--teal-600);
}

.tool-breadcrumb a:hover {
  color: var(--teal-500);
}

.tool-content {
  padding: var(--space-2xl) 0;
}

.tool-placeholder {
  background: white;
  border: 2px dashed var(--slate-300);
  border-radius: 12px;
  padding: var(--space-4xl) var(--space-2xl);
  text-align: center;
}

.tool-placeholder-icon {
  font-size: 3rem;
  margin-bottom: var(--space-lg);
}

.tool-placeholder h3 {
  margin-bottom: var(--space-md);
}

.tool-placeholder p {
  color: var(--slate-500);
  max-width: 500px;
  margin: 0 auto;
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
  background: var(--navy-900);
  color: var(--slate-400);
  padding: var(--space-3xl) 0 var(--space-2xl);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--slate-400);
}

.footer-links a:hover {
  color: var(--teal-400);
}

.footer-bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8125rem;
  color: var(--slate-500);
}

/* =========================================
   UTILITIES
   ========================================= */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* Loading spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--slate-200);
  border-top-color: var(--teal-500);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Hidden utility */
.hidden {
  display: none !important;
}
