@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   DESIGN TOKENS & RESET
   ========================================================================== */
:root {
  --primary: #22c55e;
  --primary-hover: #16a34a;
  --primary-glow: rgba(34, 197, 94, 0.4);
  --gradient-btn: linear-gradient(135deg, #22c55e, #16a34a);
  --gradient-hero: linear-gradient(135deg, #0f172a 0%, #14532d 50%, #0f172a 100%);
  --gradient-accent: linear-gradient(135deg, #22c55e, #15803d);
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-dark-card: #1e293b;
  --bg-nav: rgba(15, 23, 42, 0.8);
  --bg-footer: #0a0a0a;
  --border-color: #e2e8f0;
  --border-focus: #22c55e;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-light: #f1f5f9;
  --text-footer: #d1d5db;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 15px rgba(34, 197, 94, 0.3);
  
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
  
  --header-height: 80px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
  padding-top: var(--header-height);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  z-index: 1000;
  transition: background-color var(--transition-normal);
}

.navbar.scrolled {
  background-color: rgba(15, 23, 42, 0.95);
  box-shadow: var(--shadow-md);
}

.nav-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Inline SVG Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.5rem;
  user-select: none;
}

.logo-text {
  background: var(--gradient-btn);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  letter-spacing: -0.025em;
}

.logo-text-white {
  color: #ffffff;
  letter-spacing: -0.025em;
}

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

.nav-link {
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: width var(--transition-normal);
}

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

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

.nav-link.active {
  color: var(--primary);
}

.nav-cta-btn {
  background: var(--gradient-btn);
  color: #ffffff;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
  opacity: 0.95;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.5rem;
  z-index: 1010;
}

.bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  -webkit-transition: all 0.3s ease-in-out;
  transition: all 0.3s ease-in-out;
  background-color: var(--text-light);
  border-radius: 2px;
}

/* ==========================================================================
   BUTTONS & ACCENTS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.875rem 2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--gradient-btn);
  color: #ffffff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.btn-outline-white {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-outline-white:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--bg-dark-card);
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: #1e293b;
  transform: translateY(-2px);
}

.btn-danger-outline {
  background: transparent;
  color: #ef4444;
  border-color: #fca5a5;
}

.btn-danger-outline:hover {
  background-color: #fef2f2;
  border-color: #ef4444;
}

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

.btn-full {
  width: 100%;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
  background: var(--gradient-hero);
  color: #ffffff;
  padding: 5rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.15) 0%, transparent 70%);
  top: -10%;
  right: 5%;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.1) 0%, transparent 70%);
  bottom: -20%;
  left: -10%;
  pointer-events: none;
}

.hero-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-tagline {
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.hero-content h1 span {
  background: var(--gradient-btn);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-content p {
  font-size: 1.125rem;
  color: var(--text-light);
  opacity: 0.9;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* CSS Browser Mockup Frame */
.hero-mockup {
  position: relative;
  perspective: 1000px;
}

.browser-mockup {
  background-color: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), var(--shadow-glow);
  border: 1px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
  transform: rotateY(-6deg) rotateX(4deg);
  transition: transform var(--transition-slow);
}

.browser-mockup:hover {
  transform: rotateY(0deg) rotateX(0deg) scale(1.02);
}

.browser-header {
  background-color: #1e293b;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid #334155;
}

.browser-dots {
  display: flex;
  gap: 0.375rem;
}

.browser-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.browser-dot.red { background-color: #ef4444; }
.browser-dot.yellow { background-color: #f59e0b; }
.browser-dot.green { background-color: #10b981; }

.browser-address {
  background-color: #334155;
  color: var(--text-light);
  font-size: 0.75rem;
  padding: 0.25rem 2rem;
  border-radius: var(--radius-sm);
  flex-grow: 1;
  text-align: center;
  max-width: 320px;
  margin: 0 auto;
  opacity: 0.8;
}

.browser-body {
  padding: 1.5rem;
  background-color: #ffffff;
  color: var(--text-primary);
  font-size: 0.8rem;
}

.mock-invoice-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.mock-invoice-logo {
  font-weight: 800;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.mock-invoice-title {
  text-align: right;
}

.mock-invoice-title h4 {
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: 700;
}

.mock-invoice-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.mock-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
}

.mock-value {
  font-weight: 500;
}

.mock-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.mock-table th {
  background-color: #0f172a;
  color: #ffffff;
  padding: 0.375rem 0.5rem;
  text-align: left;
  font-size: 0.65rem;
}

.mock-table td {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.7rem;
}

.mock-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  margin-top: 0.75rem;
}

.mock-total-row {
  display: flex;
  gap: 2rem;
}

.mock-grand-total {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  border-top: 2px solid var(--primary);
  padding-top: 0.25rem;
}

/* ==========================================================================
   FEATURES SECTION
   ========================================================================== */
.section {
  padding: 6rem 1.5rem;
}

.section-white {
  background-color: #ffffff;
}

.section-container {
  max-width: 1280px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 4rem auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-header h2 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

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

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.feature-card {
  background-color: var(--bg-card);
  padding: 2.5rem 2rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(34, 197, 94, 0.4);
}

.feature-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: rgba(34, 197, 94, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.5rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==========================================================================
   HOW IT WORKS SECTION
   ========================================================================== */
.steps-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  position: relative;
  margin-top: 2rem;
}

.steps-container::before {
  content: '';
  position: absolute;
  top: 40px;
  left: 10%;
  right: 10%;
  height: 2px;
  background-color: var(--border-color);
  z-index: 1;
}

.step-card {
  text-align: center;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.step-number {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}

.step-card:hover .step-number {
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.1);
  box-shadow: var(--shadow-glow);
}

.step-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

.step-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 280px;
}

/* ==========================================================================
   SEO CONTENT BLOCK
   ========================================================================== */
.seo-section {
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.seo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.seo-paragraphs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.seo-block h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  border-left: 4px solid var(--primary);
  padding-left: 0.75rem;
}

.seo-block p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  text-align: justify;
}

/* ==========================================================================
   FAQ SECTION (ACCORDION)
   ========================================================================== */
.faq-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-normal);
}

.faq-item:hover {
  border-color: rgba(34, 197, 94, 0.4);
}

.faq-question {
  width: 100%;
  padding: 1.5rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  outline: none;
}

.faq-icon {
  font-size: 1.25rem;
  font-weight: 400;
  transition: transform var(--transition-normal);
  color: var(--text-secondary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1), padding 0.3s ease;
  padding: 0 1.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.faq-item.active {
  border-color: var(--primary);
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
  color: var(--primary);
}

.faq-item.active .faq-answer {
  max-height: 1000px; /* Large enough value */
  transition: max-height 0.3s cubic-bezier(1, 0, 1, 0), padding 0.3s ease;
  padding: 0 1.5rem 1.5rem 1.5rem;
}

/* ==========================================================================
   TESTIMONIALS SECTION
   ========================================================================== */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.testimonial-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 2.5rem 2rem;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal);
}

.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.rating {
  color: #fbbf24;
  font-size: 1.1rem;
}

.testimonial-quote {
  color: var(--text-primary);
  font-style: italic;
  font-size: 1rem;
  flex-grow: 1;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: rgba(34, 197, 94, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  border: 2px solid var(--primary);
}

.author-meta h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.author-meta p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   CTA BANNER SECTION
   ========================================================================== */
.cta-banner {
  background: var(--gradient-hero);
  color: #ffffff;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  position: relative;
  z-index: 2;
}

.cta-banner h2 {
  font-size: 2.5rem;
  font-weight: 800;
}

.cta-banner p {
  color: var(--text-light);
  font-size: 1.15rem;
  max-width: 600px;
}

/* ==========================================================================
   GENERATOR PAGE LAYOUT & INTERACTIVE STYLES
   ========================================================================== */
.generator-section {
  padding: 2rem 1.5rem;
  background-color: #f1f5f9;
}

.generator-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 55% 45%;
  gap: 2.5rem;
  align-items: start;
}

/* Form Styles */
.form-panel {
  background-color: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.fieldset-section {
  border: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.legend-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
  width: 100%;
}

.legend-title span.number-badge {
  background-color: rgba(34, 197, 94, 0.1);
  color: var(--primary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.form-row-three {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-control {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  outline: none;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  width: 100%;
  background-color: #f8fafc;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
  background-color: #ffffff;
}

textarea.form-control {
  resize: vertical;
}

/* Custom File Upload Styling */
.logo-upload-box {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  background-color: #f8fafc;
  transition: all var(--transition-normal);
  position: relative;
}

.logo-upload-box:hover {
  border-color: var(--primary);
  background-color: rgba(34, 197, 94, 0.02);
}

.logo-upload-box input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  font-size: 2rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.upload-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.upload-text span {
  color: var(--primary);
  font-weight: 600;
}

.logo-preview-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.logo-preview-container img {
  max-height: 60px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.remove-logo-btn {
  font-size: 0.8rem;
  color: #ef4444;
  cursor: pointer;
  background: none;
  border: none;
  font-weight: 600;
}

/* Items Table */
.items-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #ffffff;
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.items-table th {
  background-color: #f1f5f9;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.items-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.items-table td.center {
  text-align: center;
}

.items-table .cell-desc {
  width: 40%;
}

.items-table .cell-num {
  width: 12%;
}

.items-table .cell-amount {
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  padding-right: 1.5rem;
}

.delete-row-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.delete-row-btn:hover {
  color: #ef4444;
  background-color: #fef2f2;
}

/* Totals Summary */
.totals-grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: end;
}

.totals-group {
  margin-left: auto;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.totals-row.grand-total {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  border-top: 2px solid var(--border-color);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

.grand-total-amount {
  color: var(--primary);
}

.discount-toggle-wrapper {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.discount-type-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background-color: #e2e8f0;
  border: none;
  cursor: pointer;
}

.discount-type-btn.active {
  background-color: var(--primary);
  color: #ffffff;
}

/* Action Trigger Box */
.action-buttons-box {
  display: flex;
  gap: 1rem;
}

/* Live Invoice A4 Preview Panel */
.preview-panel {
  position: sticky;
  top: 100px;
}

.a4-paper {
  background-color: #ffffff;
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-md);
  aspect-ratio: 1 / 1.414; /* A4 aspect ratio */
  width: 100%;
  padding: 2.5rem;
  border: 1px solid var(--border-color);
  color: #1e293b;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.preview-invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.preview-brand-logo {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preview-brand-logo .invoice-logo-img {
  max-height: 50px;
  object-fit: contain;
}

.preview-company-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

.preview-meta-title-box {
  text-align: right;
}

.preview-meta-title-box h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.preview-meta-title-box p {
  color: var(--text-secondary);
}

.preview-addresses-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.preview-address-col h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.375rem;
  margin-bottom: 0.5rem;
}

.preview-address-col p {
  line-height: 1.5;
  white-space: pre-line;
}

.preview-details-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background-color: #f8fafc;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  gap: 0.5rem;
}

.preview-strip-item h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.preview-strip-item p {
  font-weight: 600;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

.preview-table th {
  background-color: #0f172a;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.65rem 0.8rem;
  text-align: left;
}

.preview-table th.right,
.preview-table td.right {
  text-align: right;
}

.preview-table td {
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
}

.preview-table tr:last-child td {
  border-bottom: 2px solid #0f172a;
}

.preview-totals-block {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 1rem;
}

.preview-notes-col {
  width: 55%;
}

.preview-notes-col h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.preview-notes-col p {
  font-size: 0.75rem;
  white-space: pre-line;
}

.preview-totals-col {
  width: 35%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preview-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.preview-total-row.grand-total {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  border-top: 2px solid var(--primary);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}

.preview-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: auto;
}

/* Floating Actions on Mobile */
.mobile-sticky-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #ffffff;
  box-shadow: 0 -10px 15px -3px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  z-index: 999;
  gap: 1rem;
  justify-content: space-between;
}

/* Modal Overlay for Mobile Preview */
.mobile-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.85);
  z-index: 2000;
  overflow-y: auto;
  padding: 1rem;
  box-sizing: border-box;
}

.mobile-modal-overlay.active {
  display: block;
}

.mobile-modal-content {
  max-width: 600px;
  margin: 2rem auto;
  position: relative;
}

.close-modal-btn {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

/* ==========================================================================
   ABOUT US, CONTACT US, & DISCLAIMER PAGES
   ========================================================================== */
.about-hero {
  background: var(--gradient-hero);
  color: #ffffff;
  padding: 5rem 1.5rem;
  text-align: center;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-img {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
}

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

.team-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-align: center;
  transition: transform var(--transition-normal);
}

.team-card:hover {
  transform: translateY(-5px);
}

.team-card h3 {
  margin-top: 1rem;
}

.contact-layout {
  display: grid;
  grid-template-columns: 4fr 5fr;
  gap: 4rem;
  align-items: start;
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-info-item {
  display: flex;
  gap: 1.5rem;
  background-color: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: border-color var(--transition-fast);
}

.contact-info-item:hover {
  border-color: var(--primary);
}

.contact-info-item .icon {
  font-size: 2rem;
  color: var(--primary);
  line-height: 1;
}

.contact-info-item h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.contact-info-item p {
  color: var(--text-secondary);
}

.legal-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: start;
}

.legal-sidebar {
  position: sticky;
  top: 100px;
  background-color: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.legal-sidebar h3 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.legal-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.legal-menu a {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
  display: block;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

.legal-menu a:hover {
  color: var(--primary);
  background-color: rgba(34, 197, 94, 0.05);
}

.legal-menu a.active {
  color: var(--primary);
  background-color: rgba(34, 197, 94, 0.1);
  font-weight: 600;
}

.legal-content-box {
  background-color: var(--bg-card);
  padding: 3rem 2.5rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.legal-block h2 {
  font-size: 1.5rem;
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.legal-block p, .legal-block ul {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.legal-block ul {
  padding-left: 1.5rem;
  margin-top: 0.5rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  background-color: var(--bg-footer);
  color: var(--text-footer);
  padding: 4rem 1.5rem 1.5rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: auto;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.footer-column h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-column h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background-color: var(--primary);
}

.footer-column p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-footer);
  transition: all var(--transition-fast);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-icon:hover {
  background-color: var(--primary);
  color: #ffffff;
  transform: translateY(-2px);
  border-color: var(--primary);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-link {
  font-size: 0.9rem;
  color: var(--text-footer);
  display: inline-block;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--primary);
  transform: translateX(3px);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.contact-info a:hover {
  color: var(--primary);
}

.whatsapp-btn {
  background-color: #25d366;
  color: #ffffff !important;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.whatsapp-btn:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

.footer-bottom {
  max-width: 1280px;
  margin: 1.5rem auto 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-bottom p span {
  color: #ef4444;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-container {
    gap: 2rem;
  }
  .hero-content h1 {
    font-size: 2.5rem;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .generator-container {
    grid-template-columns: 1fr;
  }
  .preview-panel {
    position: static;
  }
  .legal-layout {
    grid-template-columns: 1fr;
  }
  .legal-sidebar {
    position: static;
    margin-bottom: 2rem;
  }
}

@media (max-width: 768px) {
  /* Navbar adjustments */
  .hamburger {
    display: block;
  }
  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active .bar:nth-child(1) {
    -webkit-transform: translateY(8px) rotate(45deg);
    transform: translateY(8px) rotate(45deg);
  }
  .hamburger.active .bar:nth-child(3) {
    -webkit-transform: translateY(-8px) rotate(-45deg);
    transform: translateY(-8px) rotate(-45deg);
  }
  
  .nav-links {
    position: fixed;
    left: -100%;
    top: var(--header-height);
    flex-direction: column;
    background-color: rgba(15, 23, 42, 0.98);
    width: 100%;
    height: calc(100vh - var(--header-height));
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    padding: 3rem 1.5rem;
    gap: 2.5rem;
    z-index: 999;
  }
  
  .nav-links.active {
    left: 0;
  }
  
  .nav-cta-btn {
    display: none;
  }
  
  .nav-links .nav-cta-btn {
    display: inline-flex;
  }

  /* Hero Section Mobile */
  .hero {
    padding: 3rem 1rem;
  }
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  .hero-content h1 {
    font-size: 2.25rem;
  }
  .hero-content p {
    margin: 0 auto;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-mockup {
    max-width: 480px;
    margin: 0 auto;
  }
  .browser-mockup {
    transform: none !important;
  }

  /* Sections Mobile */
  .section {
    padding: 4rem 1rem;
  }
  .section-header h2 {
    font-size: 1.75rem;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .steps-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .steps-container::before {
    display: none;
  }
  .seo-paragraphs {
    grid-template-columns: 1fr;
  }
  .testimonials-grid {
    grid-template-columns: 1fr;
  }
  .grid-two {
    grid-template-columns: 1fr;
  }
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  /* Footer stack */
  .footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  /* Generator Mobile Controls */
  .generator-container {
    padding-bottom: 80px; /* Sticky bar buffer */
  }
  .preview-panel {
    display: none; /* Hide standard layout preview, show on modal */
  }
  .mobile-sticky-bar {
    display: flex;
  }
  .action-buttons-box {
    flex-direction: column;
  }
  .totals-grid-container {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   PRINT / PDF MEDIA OVERLAYS
   ========================================================================== */
@media print {
  /* Hide all interactive elements */
  body {
    padding-top: 0 !important;
    background-color: #ffffff !important;
    color: #000000 !important;
  }
  
  header,
  nav,
  .navbar,
  .form-panel,
  .mobile-sticky-bar,
  .mobile-modal-overlay,
  footer,
  .footer,
  .btn,
  .delete-row-btn,
  .add-row-btn-container,
  .remove-logo-btn,
  .logo-upload-box {
    display: none !important;
  }

  .generator-section {
    padding: 0 !important;
    background-color: #ffffff !important;
  }

  .generator-container {
    display: block !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .preview-panel {
    display: block !important;
    width: 100% !important;
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .a4-paper {
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    aspect-ratio: auto !important;
  }

  .preview-table th {
    background-color: #000000 !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .preview-details-strip {
    background-color: #f1f5f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  @page {
    size: A4;
    margin: 1.5cm;
  }
}
