/* ==========================================================================
   Silverkrest — main.css
   Shared styles for all pages
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
  /* Brand colors */
  --blue-700:   #1d4ed8;
  --blue-600:   #2563eb;
  --blue-500:   #3b82f6;
  --indigo-600: #4f46e5;
  --indigo-500: #6366f1;
  --indigo-400: #818cf8;
  --indigo-300: #a5b4fc;

  /* Neutrals */
  --slate-950:  #020617;
  --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;
  --white:      #ffffff;

  /* Semantic */
  --color-primary:       var(--indigo-500);
  --color-primary-dark:  var(--indigo-600);
  --color-primary-light: var(--indigo-300);
  --color-text:          var(--slate-900);
  --color-text-muted:    var(--slate-500);
  --color-bg:            var(--white);
  --color-bg-alt:        var(--slate-50);
  --color-border:        var(--slate-200);

  /* Gradients */
  --grad-brand: linear-gradient(135deg, var(--blue-700), var(--indigo-500));
  --grad-hero:  linear-gradient(160deg, #0f172a 0%, #1e1b4b 55%, #1e293b 100%);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', Consolas, 'Courier New', monospace;

  /* Spacing */
  --section-py: 5rem;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.07);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.08);
  --shadow-xl: 0 20px 60px rgba(0,0,0,.16);

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;

  /* Nav */
  --nav-height: 68px;
}

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

/* Ensure HTML hidden attribute always wins over CSS display rules */
[hidden] { display: none !important; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p { line-height: 1.75; }

.lead {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.text-sm   { font-size: 0.875rem; }
.text-xs   { font-size: 0.75rem; }
.text-lg   { font-size: 1.125rem; }
.text-xl   { font-size: 1.25rem; }

.text-muted   { color: var(--color-text-muted); }
.text-center  { text-align: center; }
.text-white   { color: var(--white); }
.font-bold    { font-weight: 700; }
.font-semibold{ font-weight: 600; }

/* Gradient text */
.text-gradient {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.container-sm {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-lg {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section { padding: var(--section-py) 0; }
.section-sm { padding: 3rem 0; }
.section-lg { padding: 7rem 0; }

.section-alt { background: var(--color-bg-alt); }
.section-dark {
  background: var(--grad-hero);
  color: var(--white);
}

/* Grid helpers */
.grid { display: grid; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition: background var(--transition-slow), box-shadow var(--transition-slow), backdrop-filter var(--transition-slow);
}

/* Transparent state (on hero) */
.nav--transparent {
  background: rgba(255,255,255,0);
}

/* Scrolled / solid state */
.nav--solid {
  background: rgba(255,255,255,0.97);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  box-shadow: var(--shadow-sm);
}

/* Dark hero pages — scrolled becomes solid white */
.nav--dark-hero.nav--transparent {
  background: rgba(10,15,30,0);
}

.nav__inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav__logo img {
  height: 36px;
  width: auto;
}

/* Logo swap: show color logo when solid, white when transparent */
.nav__logo-white { display: block; }
.nav__logo-color { display: none; }

.nav--solid .nav__logo-white { display: none; }
.nav--solid .nav__logo-color { display: block; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  justify-content: center;
}

.nav__link {
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  transition: color var(--transition), background var(--transition);
  color: rgba(255,255,255,0.85);
}

.nav__link:hover {
  color: var(--white);
  background: rgba(255,255,255,0.1);
}

.nav--solid .nav__link {
  color: var(--slate-700);
}

.nav--solid .nav__link:hover {
  color: var(--slate-900);
  background: var(--slate-100);
}

.nav__link--active {
  color: var(--white) !important;
  background: rgba(255,255,255,0.15) !important;
}

.nav--solid .nav__link--active {
  color: var(--indigo-600) !important;
  background: rgba(99,102,241,0.08) !important;
}

.nav__cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.nav__login {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  color: rgba(255,255,255,0.85);
  transition: all var(--transition);
}

.nav__login:hover { color: var(--white); }

.nav--solid .nav__login { color: var(--slate-600); }
.nav--solid .nav__login:hover { color: var(--slate-900); }

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  gap: 5px;
  transition: background var(--transition);
}

.nav__hamburger:hover { background: rgba(255,255,255,0.1); }
.nav--solid .nav__hamburger:hover { background: var(--slate-100); }

.nav__hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all var(--transition);
}

.nav--solid .nav__hamburger span { background: var(--slate-700); }

.nav__hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__hamburger.is-open span:nth-child(2) { opacity: 0; }
.nav__hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.nav__mobile {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: var(--slate-900);
  padding: 1.5rem;
  border-bottom: 1px solid var(--slate-800);
  flex-direction: column;
  gap: 0.25rem;
  z-index: 999;
  animation: slideDown 0.25s ease;
}

.nav__mobile.is-open { display: flex; }

.nav__mobile .nav__link {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
  border-radius: var(--radius-md);
}

.nav__mobile .nav__link:hover {
  color: var(--white);
  background: rgba(255,255,255,0.08);
}

.nav__mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--slate-800);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius-full);
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  letter-spacing: 0.01em;
}

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary {
  background: var(--grad-brand);
  color: var(--white);
  box-shadow: 0 4px 18px rgba(99,102,241,0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(99,102,241,0.45);
  filter: brightness(1.08);
}

.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.35);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.65);
}

.btn-outline-dark {
  background: transparent;
  color: var(--slate-700);
  border-color: var(--slate-300);
}

.btn-outline-dark:hover {
  background: var(--slate-100);
  border-color: var(--slate-400);
  color: var(--slate-900);
}

.btn-ghost {
  color: var(--indigo-600);
  padding: 0.6rem 1rem;
}

.btn-ghost:hover {
  background: rgba(99,102,241,0.08);
}

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

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

.btn-full { width: 100%; }

/* --------------------------------------------------------------------------
   Badges / Tags
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-indigo {
  background: rgba(99,102,241,0.12);
  color: var(--indigo-600);
}

.badge-blue {
  background: rgba(59,130,246,0.12);
  color: var(--blue-600);
}

.badge-white {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
}

.badge-popular {
  background: var(--grad-brand);
  color: var(--white);
  box-shadow: 0 2px 10px rgba(99,102,241,0.4);
}

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

.section-header .badge {
  margin-bottom: 1rem;
}

.section-header h2 {
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition-slow);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: rgba(99,102,241,0.2);
}

.card-flat { box-shadow: none; }
.card-flat:hover { box-shadow: var(--shadow-md); }

/* --------------------------------------------------------------------------
   Feature Icons
   -------------------------------------------------------------------------- */
.icon-box {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  background: rgba(99,102,241,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-box svg { width: 26px; height: 26px; color: var(--indigo-500); }
.icon-box--sm { width: 40px; height: 40px; border-radius: var(--radius-sm); }
.icon-box--sm svg { width: 20px; height: 20px; }

.icon-box--blue   { background: rgba(59,130,246,0.1); }
.icon-box--blue svg { color: var(--blue-500); }
.icon-box--gradient {
  background: var(--grad-brand);
}
.icon-box--gradient svg { color: var(--white); }

/* --------------------------------------------------------------------------
   Checkmark list
   -------------------------------------------------------------------------- */
.check-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9375rem;
  color: var(--slate-700);
  line-height: 1.5;
}

.check-list li::before {
  content: '';
  display: inline-block;
  width: 18px; height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236366f1'%3E%3Ccircle cx='10' cy='10' r='10' fill='%23e0e7ff'/%3E%3Cpath d='M6 10l3 3 5-5' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E") no-repeat center/contain;
  flex-shrink: 0;
  margin-top: 2px;
}

.check-list--white li { color: rgba(255,255,255,0.9); }
.check-list--white li::before {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='10' fill='rgba(255,255,255,0.2)'/%3E%3Cpath d='M6 10l3 3 5-5' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E") no-repeat center/contain;
}

/* --------------------------------------------------------------------------
   Stats / KPI row
   -------------------------------------------------------------------------- */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.stat {
  text-align: center;
}

.stat__num {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat__label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Testimonial card
   -------------------------------------------------------------------------- */
.testimonial {
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.testimonial__stars { margin-bottom: 1rem; color: #f59e0b; font-size: 1rem; letter-spacing: 2px; }

.testimonial__quote {
  font-size: 0.9375rem;
  color: var(--slate-700);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.testimonial__author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.testimonial__avatar {
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  background: var(--grad-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--white);
  flex-shrink: 0;
}

.testimonial__name { font-weight: 700; font-size: 0.9rem; }
.testimonial__role { font-size: 0.8rem; color: var(--color-text-muted); }

/* --------------------------------------------------------------------------
   CTA Banner
   -------------------------------------------------------------------------- */
.cta-banner {
  background: var(--grad-brand);
  border-radius: var(--radius-xl);
  padding: 3.5rem 2rem;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 250px; height: 250px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  pointer-events: none;
}

.cta-banner::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -40px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}

.cta-banner h2 { color: var(--white); margin-bottom: 0.75rem; }
.cta-banner p  { color: rgba(255,255,255,0.8); margin-bottom: 2rem; font-size: 1.0625rem; }

.cta-banner__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  background: var(--slate-950);
  color: rgba(255,255,255,0.65);
  padding: 4rem 0 2rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer__brand p {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-top: 1rem;
  color: rgba(255,255,255,0.5);
  max-width: 280px;
}

.footer__logo { height: 34px; }

.footer__col h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin-bottom: 1rem;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer__links a {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  transition: color var(--transition);
}

.footer__links a:hover { color: var(--white); }

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer__bottom p { font-size: 0.85rem; }

.footer__legal {
  display: flex;
  gap: 1.5rem;
}

.footer__legal a {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
  transition: color var(--transition);
}

.footer__legal a:hover { color: rgba(255,255,255,0.75); }

/* --------------------------------------------------------------------------
   Page hero (inner pages)
   -------------------------------------------------------------------------- */
.page-hero {
  background: var(--grad-hero);
  color: var(--white);
  padding: calc(var(--nav-height) + 4rem) 0 5rem;
  text-align: center;
}

.page-hero h1 { color: var(--white); margin-bottom: 1rem; }
.page-hero .lead { color: rgba(255,255,255,0.72); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate-700);
}

.form-control {
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--slate-300);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: var(--slate-900);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

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

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

/* --------------------------------------------------------------------------
   Divider
   -------------------------------------------------------------------------- */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: 2rem 0;
}

/* --------------------------------------------------------------------------
   Scroll-reveal utility
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* --------------------------------------------------------------------------
   Responsive — Tablet
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  :root {
    --section-py: 3.5rem;
    --nav-height: 62px;
  }

  .nav__links,
  .nav__login { display: none; }

  .nav__hamburger { display: flex; }

  /* Buttons with text labels only on desktop */
  .btn-lg { padding: 0.75rem 1.5rem; }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer__legal { justify-content: center; }

  .cta-banner { padding: 2.5rem 1.5rem; }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
}
