/* Basil Insurance - Modern Fintech-Inspired Design */

/* ==================== CSS Variables ==================== */
:root {
  /* Brand Colors */
  --basil-green: #00C853;
  --deep-green: #00A844;
  --mint: #69F0AE;
  --green-tint: #E8F5E9;

  /* Neutrals */
  --near-black: #111111;
  --dark-card: #1A1A1A;
  --elevated: #242424;
  --off-white: #FAFAFA;
  --white: #FFFFFF;

  /* Accents */
  --warm-gold: #FFB74D;
  --coral: #FF6B6B;
  --muted-gray: #9E9E9E;
  --dark-gray: #666666;

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #111111 0%, #1A1A1A 100%);
  --gradient-green: linear-gradient(135deg, #00C853 0%, #00A844 100%);
  --gradient-accent: linear-gradient(135deg, #FFB74D 0%, #FF6B6B 100%);
  --gradient-card: linear-gradient(135deg, rgba(0, 200, 83, 0.05) 0%, rgba(0, 168, 68, 0.05) 100%);

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-green: 0 4px 16px rgba(0, 200, 83, 0.3);

  /* Typography */
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --section-padding: 80px;
  --container-max: 1200px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--near-black);
  color: var(--white);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 2000;
  background: var(--white);
  color: var(--near-black);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-weight: 700;
}

.skip-link:focus {
  top: 1rem;
}

/* ==================== Typography ==================== */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
  margin-bottom: 1rem;
  color: var(--muted-gray);
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 3px;
}

/* ==================== Container ==================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: var(--section-padding) 0;
  position: relative;
}

/* ==================== Navigation ==================== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(17, 17, 17, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

nav.scrolled {
  background: rgba(17, 17, 17, 0.98);
  box-shadow: var(--shadow-lg);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: var(--container-max);
  margin: 0 auto;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 0.45rem;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-direction: column;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: opacity 0.2s ease;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-serif);
}

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

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--white);
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
  font-size: 1rem;
}

.nav-links button {
  color: var(--white);
  font-weight: 500;
  position: relative;
  font-size: 1rem;
}

.nav-links a.btn {
  padding: 0.75rem 1.5rem;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-green);
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-dropdown-toggle.active {
  text-decoration: underline;
  text-decoration-color: var(--basil-green);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

/* Navigation Dropdown */
.nav-links li {
  position: relative;
}

.nav-dropdown {
  position: relative;
  cursor: pointer;
}

.nav-dropdown > a,
.nav-dropdown > button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap !important;
}

.nav-dropdown-toggle {
  background: transparent;
  border: none;
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem 0;
}

.nav-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--elevated);
  border: 1px solid rgba(0, 200, 83, 0.2);
  border-radius: 8px;
  min-width: 220px;
  margin-top: 0;
  padding-top: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

.nav-dropdown-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1rem;
  background: transparent;
}

.nav-dropdown:hover .nav-dropdown-content,
.nav-dropdown:focus-within .nav-dropdown-content,
.nav-dropdown.open .nav-dropdown-content {
  display: block;
}

.nav-dropdown-content a {
  display: block;
  padding: 0.75rem 1.25rem;
  color: var(--white);
  font-size: 0.9rem;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.nav-dropdown-content a:first-child {
  margin-top: 0;
}

.nav-dropdown-content a:last-child {
  margin-bottom: 0.5rem;
}

.nav-dropdown-content a::after {
  display: none;
}

.nav-dropdown-content a:hover {
  background: rgba(0, 200, 83, 0.1);
}

.nav-dropdown > a::after,
.nav-dropdown > button::after {
  display: inline-block;
  content: '▾';
  font-size: 0.8rem;
  line-height: 0;
  white-space: nowrap;
  position: static;
  width: auto;
  height: auto;
  background: none;
  margin-left: 0.25rem;
  transform: scale(2.2);
  transform-origin: center;
  vertical-align: middle;
}

/* ==================== Buttons ==================== */
.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  text-align: center;
}

.btn-primary {
  background: var(--gradient-green);
  color: var(--white);
  box-shadow: var(--shadow-green);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 200, 83, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--basil-green);
}

.btn-large {
  padding: 1.125rem 2.5rem;
  font-size: 1.125rem;
}

/* ==================== Hero Section ==================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--gradient-hero);
  overflow: hidden;
  padding-top: 80px;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(0, 200, 83, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 183, 77, 0.1) 0%, transparent 50%);
  animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, rgba(17, 17, 17, 0.8) 0%, rgba(17, 17, 17, 0.35) 45%, transparent 70%);
  z-index: 1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  animation: fadeInUp 1s ease-out;
}

.hero-tagline {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(0, 200, 83, 0.1);
  border: 1px solid rgba(0, 200, 83, 0.3);
  border-radius: 50px;
  color: var(--mint);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
}

.hero h1 {
  background: linear-gradient(135deg, var(--white) 0%, var(--mint) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.25rem;
  color: var(--muted-gray);
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== Cards ==================== */
.card {
  background: var(--dark-card);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-green);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0, 200, 83, 0.3);
}

.card:hover::before {
  transform: scaleX(1);
}

.card-icon {
  width: 60px;
  height: 60px;
  background: var(--gradient-green);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.card h3 {
  color: var(--white);
  margin-bottom: 0.75rem;
}

.card p {
  color: var(--muted-gray);
  line-height: 1.7;
}

/* ==================== Grid Layouts ==================== */
.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));
}

/* Keep product card CTAs aligned regardless of copy length */
#products .card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#products .card .btn {
  margin-top: auto;
}

/* ==================== Section Headers ==================== */
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem;
}

.section-label {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background: rgba(0, 200, 83, 0.1);
  border: 1px solid rgba(0, 200, 83, 0.3);
  border-radius: 50px;
  color: var(--basil-green);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.section-header h2 {
  color: var(--white);
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.125rem;
  line-height: 1.8;
}

/* ==================== Forms ==================== */
.form-group {
  margin-bottom: 1.5rem;
}

fieldset.form-group {
  border: 0;
  margin: 0 0 1.5rem;
  padding: 0;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--white);
}

.form-group label .required {
  color: var(--coral);
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--elevated);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--white);
  font-size: 1rem;
  font-family: var(--font-sans);
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--basil-green);
  box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.1);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

select.form-control {
  cursor: pointer;
}

.bot-trap {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--elevated);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.checkbox-label:hover {
  border-color: var(--basil-green);
  background: rgba(0, 200, 83, 0.05);
}

.checkbox-label input[type="checkbox"] {
  cursor: pointer;
}

/* ==================== Stats/Numbers ==================== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  text-align: center;
}

.stat-item {
  padding: 2rem;
  background: var(--dark-card);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  background: var(--gradient-green);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--muted-gray);
  font-weight: 500;
}

/* ==================== Footer ==================== */
footer {
  background: var(--dark-card);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3rem 0 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: var(--white);
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.75rem;
}

.footer-section a {
  color: var(--muted-gray);
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--basil-green);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted-gray);
  font-size: 0.875rem;
}

/* ==================== Animations ==================== */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
  :root {
    --section-padding: 50px;
  }

  .nav-container {
    position: relative;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .logo {
    flex: 1 1 auto;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(17, 17, 17, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1rem 1.5rem 2rem;
    flex-direction: column;
    gap: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.25s ease, opacity 0.25s ease;
  }

  nav.nav-open .nav-links {
    max-height: 100vh;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    padding: 0.45rem 0;
  }

  .nav-links button {
    padding: 0.45rem 0;
    width: auto;
  }

  .nav-links li {
    padding: 0;
    margin: 0;
  }

  .nav-links > li + li {
    margin-top: 0.5rem;
  }

  .nav-links > li.nav-dropdown + li {
    margin-top: 0.25rem;
  }

  .nav-dropdown:hover .nav-dropdown-content {
    display: none;
  }

  .nav-dropdown.open .nav-dropdown-content {
    display: block;
    position: static;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
  }

  .nav-dropdown-content {
    margin: 0;
    padding: 0;
  }

  .nav-dropdown-content a {
    white-space: normal;
  }

  .nav-dropdown-content::before {
    display: none;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .grid {
    gap: 1.5rem;
  }
}

/* ==================== Utility Classes ==================== */
.text-center { text-align: center; }
.text-gradient {
  background: var(--gradient-green);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
