/* ===== UNIVERSAL RESET - Fix uppercase/overlap ===== */
html, body, div, span, h1, h2, h3, h4, h5, h6, p, a, li, ul, ol,
table, thead, tbody, tr, th, td, form, input, select, textarea, button,
label, nav, header, footer, section, article, aside, main {
  text-transform: none !important;
  letter-spacing: normal !important;
  font-family: var(--font) !important;
  box-sizing: border-box;
}

/* ===== CSS Variables ===== */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #e0e7ff;
  --secondary: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: all .2s ease;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --shadow: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.3);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,.4);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background .3s, color .3s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  text-transform: none !important;
  letter-spacing: normal !important;
}
p, span, a, li, td, th, label, input, select, textarea, button {
  font-family: var(--font);
  text-transform: none;
  letter-spacing: normal;
}

/* ===== Utilities ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .625rem 1.375rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.4;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,.4); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-secondary { background: var(--bg-secondary); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-sm { padding: .375rem .875rem; font-size: .8125rem; }
.btn-lg { padding: .875rem 2rem; font-size: 1rem; }
.btn-icon {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: .5rem;
  border-radius: var(--radius-sm); transition: var(--transition);
  font-size: 1rem; display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--bg-secondary); color: var(--text); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ===== Forms ===== */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block; font-size: .875rem; font-weight: 600;
  margin-bottom: .4rem; color: var(--text);
  text-transform: none; letter-spacing: normal;
}
.form-control {
  width: 100%; padding: .625rem .875rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-size: .9375rem;
  font-family: var(--font); transition: var(--transition);
  text-transform: none; letter-spacing: normal;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: .8125rem; color: var(--text-muted); margin-top: .3rem; }
.form-error { font-size: .8125rem; color: var(--danger); margin-top: .3rem; }

/* ===== Cards ===== */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow); transition: var(--transition);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.card-title { font-size: 1.0625rem; font-weight: 700; color: var(--text); text-transform: none; }

/* ===== Alerts ===== */
.alert {
  padding: .875rem 1.125rem; border-radius: var(--radius-sm);
  margin-bottom: 1rem; font-size: .9rem;
  display: flex; align-items: flex-start; gap: .625rem;
  font-family: var(--font); text-transform: none;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
[data-theme="dark"] .alert-success { background: #064e3b; color: #6ee7b7; border-color: #065f46; }
[data-theme="dark"] .alert-error   { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
[data-theme="dark"] .alert-warning { background: #78350f; color: #fde68a; border-color: #92400e; }

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .65rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600;
  text-transform: none; letter-spacing: normal;
  font-family: var(--font);
}
.badge-success   { background: #d1fae5; color: #065f46; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-primary   { background: var(--primary-light); color: var(--primary-dark); }
.badge-secondary { background: var(--bg-secondary); color: var(--text-muted); }
[data-theme="dark"] .badge-success { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .badge-danger  { background: #7f1d1d; color: #fca5a5; }

/* ===== Navbar ===== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: .875rem 0;
}
[data-theme="dark"] .navbar { background: rgba(15,23,42,.95); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.logo {
  font-size: 1.375rem; font-weight: 800; color: var(--primary);
  display: flex; align-items: center; gap: .5rem;
  text-transform: none; letter-spacing: normal; font-family: var(--font);
}
.logo:hover { color: var(--primary-dark); }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a {
  color: var(--text-muted); font-weight: 500; font-size: .9375rem;
  text-transform: none; letter-spacing: normal;
}
.nav-links a:hover { color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: .75rem; }
.nav-toggle { display: none; }

/* ===== Hero ===== */
.hero {
  padding: 6rem 0 4rem;
  background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 50%, #f0fdf4 100%);
  text-align: center;
}
[data-theme="dark"] .hero { background: linear-gradient(135deg, #1e1b4b 0%, #1e293b 50%, #0f2d1f 100%); }
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--primary-light); color: var(--primary-dark);
  padding: .375rem 1rem; border-radius: 999px;
  font-size: .8125rem; font-weight: 600; margin-bottom: 1.5rem;
  text-transform: none;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800; line-height: 1.15; margin-bottom: 1.25rem;
  text-transform: none; letter-spacing: -.02em;
}
.hero h1 span {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { font-size: 1.125rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 2.5rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 3rem; justify-content: center; margin-top: 3rem; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 1.75rem; font-weight: 800; color: var(--primary); }
.hero-stat span { font-size: .875rem; color: var(--text-muted); }

/* ===== Section ===== */
.section { padding: 5rem 0; }
.section-alt { background: var(--bg-secondary); }
.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-header h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800; margin-bottom: .75rem;
  text-transform: none; letter-spacing: -.01em;
}
.section-header p { color: var(--text-muted); font-size: 1.0625rem; max-width: 560px; margin: 0 auto; }

/* ===== Features Grid ===== */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.feature-card {
  padding: 2rem; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  transition: var(--transition);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.feature-icon {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.375rem; margin-bottom: 1.25rem;
}
.feature-card h3 { font-size: 1.0625rem; font-weight: 700; margin-bottom: .5rem; text-transform: none; }
.feature-card p { color: var(--text-muted); font-size: .9375rem; }

/* ===== Pricing ===== */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.pricing-card {
  border-radius: var(--radius-lg); border: 2px solid var(--border);
  padding: 2rem; background: var(--bg-card);
  transition: var(--transition); position: relative;
}
.pricing-card.popular { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,102,241,.1); }
.popular-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff;
  padding: .25rem 1rem; border-radius: 999px;
  font-size: .75rem; font-weight: 700; white-space: nowrap;
  text-transform: none;
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pricing-name { font-size: 1.125rem; font-weight: 700; margin-bottom: .5rem; text-transform: none; }
.pricing-price { font-size: 2.5rem; font-weight: 800; color: var(--primary); line-height: 1; }
.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.pricing-features { margin: 1.5rem 0; }
.pricing-features li {
  display: flex; align-items: center; gap: .625rem;
  padding: .5rem 0; font-size: .9375rem;
  border-bottom: 1px solid var(--border);
  text-transform: none;
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-features li i { color: var(--success); font-size: .875rem; flex-shrink: 0; }

/* ===== Testimonials ===== */
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.testimonial-card { padding: 1.75rem; border-radius: var(--radius); background: var(--bg-card); border: 1px solid var(--border); }
.testimonial-text { font-size: .9375rem; color: var(--text-muted); margin-bottom: 1.25rem; font-style: italic; line-height: 1.7; }
.testimonial-author { display: flex; align-items: center; gap: .875rem; }
.testimonial-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.125rem; flex-shrink: 0;
}
.testimonial-name { font-weight: 600; font-size: .9375rem; text-transform: none; }
.testimonial-role { font-size: .8125rem; color: var(--text-muted); }
.stars { color: #f59e0b; font-size: .875rem; margin-bottom: .75rem; }

/* ===== FAQ ===== */
.faq-list { max-width: 720px; margin: 0 auto; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .75rem; overflow: hidden; }
.faq-question {
  padding: 1.125rem 1.25rem; font-weight: 600; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-card); font-size: .9375rem; text-transform: none;
}
.faq-question:hover { background: var(--bg-secondary); }
.faq-answer {
  padding: 0 1.25rem; max-height: 0; overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
  color: var(--text-muted); font-size: .9375rem;
}
.faq-item.open .faq-answer { max-height: 300px; padding: 1rem 1.25rem; }
.faq-item.open .faq-icon { transform: rotate(180deg); }
.faq-icon { transition: transform .3s; }

/* ===== Auth Pages ===== */
.auth-page {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
  padding: 2rem 1rem;
}
[data-theme="dark"] .auth-page { background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%); }
.auth-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2.5rem;
  width: 100%; max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,.1);
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-title {
  font-size: 1.625rem; font-weight: 800; text-align: center;
  margin-bottom: .5rem; text-transform: none; letter-spacing: -.01em;
}
.auth-subtitle { text-align: center; color: var(--text-muted); font-size: .9375rem; margin-bottom: 2rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .9rem; color: var(--text-muted); }

/* ===== Tables ===== */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg-secondary); }
th {
  padding: .875rem 1rem; text-align: left;
  font-size: .8125rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase !important; letter-spacing: .05em !important; white-space: nowrap;
}
td { padding: .875rem 1rem; font-size: .9rem; border-top: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: var(--bg-secondary); }

/* ===== Footer ===== */
.footer { background: var(--bg-secondary); border-top: 1px solid var(--border); padding: 4rem 0 2rem; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 3rem; margin-bottom: 3rem; }
.footer-brand p { color: var(--text-muted); font-size: .9375rem; margin: .75rem 0 1.25rem; }
.footer-col h4 { font-weight: 700; margin-bottom: 1rem; font-size: .9375rem; text-transform: none; }
.footer-col a { display: block; color: var(--text-muted); font-size: .9375rem; margin-bottom: .625rem; }
.footer-col a:hover { color: var(--primary); }
.social-links { display: flex; gap: .75rem; }
.social-links a {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--border); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; font-size: .875rem;
}
.social-links a:hover { background: var(--primary); color: #fff; }
.newsletter-form { display: flex; gap: .5rem; margin-top: .75rem; }
.newsletter-form input {
  flex: 1; padding: .5rem .75rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-size: .875rem;
  font-family: var(--font);
}
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.5rem; text-align: center; color: var(--text-muted); font-size: .875rem; }

/* ===== Skeleton Loader ===== */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-secondary) 50%, var(--border) 75%);
  background-size: 200% 100%; animation: skeleton-loading 1.5s infinite; border-radius: var(--radius-sm);
}
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== Spinner ===== */
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg); flex-direction: column; align-items: center;
    justify-content: center; gap: 2rem; z-index: 200;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .hero { padding: 4rem 0 3rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.5rem; }
  .auth-card { padding: 1.75rem 1.25rem; }
}
