/* ==========================================================================
   Invoice Maker — Web Design System
   Exact Theme Match with Flutter Mobile App (Saddle Brown & Warm Terracotta)
   ========================================================================== */

:root {
  /* Brand Primary Tokens (Matches AppColors.primary, primaryLight, primaryDark) */
  --primary: #8B4513;          /* Saddle Brown */
  --primary-light: #A75D28;    /* Warm Caramel */
  --primary-dark: #5C2D0C;     /* Deep Espresso Brown */
  --on-primary: #FFFFFF;       /* Crisp White Contrast */

  /* Secondary Accent Tokens (Matches AppColors.secondary, secondaryLight, secondaryDark) */
  --secondary: #D27D2D;        /* Warm Terracotta / Golden Ochre */
  --secondary-light: #E69A52;  /* Amber Sand */
  --secondary-dark: #A55718;   /* Deep Terracotta */

  /* Text & Link Brand Accent */
  --brand-text: #8B4513;
  --brand-link: #8B4513;
  --brand-hover: #5C2D0C;

  /* App Background & Surface (Matches AppColors.backgroundLight & surfaceLight) */
  --bg-page: #FAF7F5;          /* Warm Ivory / Linen */
  --bg-page-secondary: #F2EFEA;/* Soft Linen Grey */
  --bg-card: #FFFFFF;          /* Pure White Card Surface */
  --bg-card-subtle: #FAF7F5;

  /* Neutral Warm Borders (Matches AppColors.grey100 - grey300) */
  --border: #E2DDD7;           /* Warm Sand Border */
  --border-subtle: #F2EFEA;    /* Soft Warm Border */
  --border-strong: #C5BCB3;    /* Medium Warm Border */
  --border-accent: rgba(139, 69, 19, 0.25);
  --border-lime: var(--border-accent); /* Backward compatibility */

  /* Typography Colors (Matches AppColors.grey900, grey700, grey500, grey400) */
  --text-main: #16120E;        /* Near-Black Espresso */
  --text-secondary: #3B322A;   /* Deep Warm Grey */
  --text-muted: #706458;       /* Muted Warm Slate */
  --text-subtle: #988C80;      /* Light Neutral Warm Grey */

  /* Status Colors */
  --success: #16A34A;
  --success-bg: #ECFDF5;
  --success-border: #A7F3D0;
  --error: #DC2626;
  --error-bg: #FEF2F2;
  --error-border: #FECACA;
  --warning: #D97706;
  --warning-bg: #FFF7ED;
  --warning-border: #FED7AA;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(22, 18, 14, 0.05);
  --shadow-card: 0 4px 18px rgba(139, 69, 19, 0.06), 0 1px 3px rgba(22, 18, 14, 0.03);
  --shadow-card-hover: 0 12px 30px rgba(139, 69, 19, 0.12), 0 0 14px rgba(210, 125, 45, 0.2);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Typography */
  --font-main: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Glass Navigation */
.site-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-icon-img {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: cover;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.brand-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--primary);
  color: var(--on-primary);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-accent);
  margin-left: 0.2rem;
}

.nav-links {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--primary);
  background: rgba(139, 69, 19, 0.08);
}

.nav-link.active {
  color: var(--on-primary);
  background: var(--primary);
  font-weight: 700;
}

/* Container */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 4rem;
  flex: 1;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(139, 69, 19, 0.09);
  color: var(--primary);
  border: 1px solid var(--border-accent);
  margin-bottom: 1.25rem;
}

.badge-danger {
  background: var(--error-bg);
  color: var(--error);
  border-color: var(--error-border);
}

/* Hero Section */
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(210, 125, 45, 0.16) 0%, rgba(139, 69, 19, 0) 70%);
  pointer-events: none;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
}

.hero-content {
  flex: 1;
  max-width: 680px;
}

.hero-icon-large {
  width: 110px;
  height: 110px;
  border-radius: 26px;
  box-shadow: 0 10px 28px rgba(92, 45, 12, 0.14), 0 0 16px rgba(210, 125, 45, 0.22);
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: block;
}

.page-title {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.9rem;
  color: var(--text-main);
}

.page-title .accent-text {
  color: var(--primary);
  background: linear-gradient(120deg, rgba(210, 125, 45, 0.2) 0%, rgba(139, 69, 19, 0.05) 100%);
  padding: 0 0.35rem;
  border-radius: 6px;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.page-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Quick Metrics Row */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.75rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  box-shadow: var(--shadow-sm);
}

.metric-card .metric-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}

.metric-card .metric-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Section Headings */
.section-header {
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.3rem;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--secondary);
  box-shadow: var(--shadow-card-hover);
}

.feature-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--on-primary);
  margin-bottom: 1.15rem;
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
}

.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

.feature-tag {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-page);
  color: var(--text-secondary);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Hub Grid (Legal Links) */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.75rem;
}

.hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.hub-card:hover {
  transform: translateY(-3px);
  border-color: var(--secondary);
  box-shadow: var(--shadow-card-hover);
}

.hub-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
}

.hub-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.hub-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.4rem;
  flex: 1;
}

.card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand-link);
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.card-action:hover {
  color: var(--brand-hover);
}

/* Content Card (Article / Text / Specs) */
.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2.25rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 2.5rem;
}

.content-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
}

.content-card h2:first-of-type {
  margin-top: 0;
}

.content-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
}

.content-card p {
  font-size: 0.96rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.content-card ul, .content-card ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.content-card li {
  font-size: 0.94rem;
  line-height: 1.65;
  margin-bottom: 0.5rem;
}

.content-card li strong {
  color: var(--text-main);
}

.content-card a {
  color: var(--brand-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.content-card a:hover {
  color: var(--brand-hover);
}

.content-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
  background: var(--bg-page-secondary);
  color: var(--primary-dark);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Callout Boxes */
.callout {
  background: #FAF5F0;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.callout p {
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.callout-danger {
  background: var(--error-bg);
  border-color: var(--error-border);
  border-left: 4px solid var(--error);
}

.callout-warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  border-left: 4px solid var(--warning);
}

/* Steps Grid (Delete Account) */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.step-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--on-primary);
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  border: 1px solid var(--border-accent);
}

.step-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.45rem;
}

.step-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 0 !important;
}

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

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  background: #FFFFFF;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.92rem;
  color: var(--text-main);
  transition: all 0.2s ease;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.18);
}

.form-control::placeholder {
  color: var(--text-subtle);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.65rem;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--on-primary);
  border: 1px solid var(--border-accent);
  box-shadow: 0 3px 12px rgba(139, 69, 19, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary) 100%);
  box-shadow: 0 6px 18px rgba(139, 69, 19, 0.35);
  transform: translateY(-2px);
}

.btn-secondary {
  background: #FFFFFF;
  color: var(--text-main);
  border: 1.5px solid var(--border);
}

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

.btn-danger {
  background: var(--error);
  color: #FFFFFF;
}

.btn-danger:hover {
  background: #B91C1C;
  transform: translateY(-2px);
}

/* Footer */
.site-footer {
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  padding: 2.25rem 1.5rem;
  text-align: center;
  margin-top: auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--brand-link);
}

.site-footer p {
  font-size: 0.82rem;
  color: var(--text-subtle);
}

/* Responsive */
@media (max-width: 768px) {
  .hero-inner {
    flex-direction: column-reverse;
    text-align: center;
    gap: 1.5rem;
  }

  .hero-icon-large {
    width: 84px;
    height: 84px;
    border-radius: 20px;
  }

  .page-title {
    font-size: 1.85rem;
  }

  .hero-card {
    padding: 2rem 1.5rem;
  }

  .content-card {
    padding: 1.75rem 1.25rem;
  }

  .header-inner {
    flex-direction: column;
    gap: 0.75rem;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
  }

  .nav-link {
    font-size: 0.82rem;
    padding: 0.4rem 0.65rem;
  }
}
