/* ===== ROOT VARIABLES ===== */
:root {
  --primary: #2563EB;
  --primary-dark: #1E40AF;
  --accent: #3B82F6;
  --success: #10B981;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --text: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --border-focus: #2563EB;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --bg: #0F172A;
  --surface: #1E293B;
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --border: #334155;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.4);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
*:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }
p { color: var(--text-muted); }

/* ===== LAYOUT ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }

/* ===== HEADER / NAV ===== */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(248,250,252,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), box-shadow var(--transition);
}
[data-theme="dark"] #site-header { background: rgba(15,23,42,0.92); }
#site-header.scrolled { box-shadow: var(--shadow-sm); }
nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.nav-logo { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.nav-logo-icon { width: 34px; height: 34px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-logo-icon svg { width: 20px; height: 20px; fill: #fff; }
.nav-links { display: flex; align-items: center; gap: 0.25rem; list-style: none; }
.nav-links a { padding: 0.4rem 0.8rem; border-radius: 8px; font-size: 0.9rem; font-weight: 500; color: var(--text-muted); transition: background var(--transition), color var(--transition); }
.nav-links a:hover { background: var(--border); color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 0.5rem; }
.btn-theme { background: none; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; padding: 0.4rem 0.6rem; color: var(--text-muted); transition: all var(--transition); display: flex; align-items: center; justify-content: center; }
.btn-theme:hover { border-color: var(--primary); color: var(--primary); }
.btn-theme svg { width: 18px; height: 18px; }
.nav-mobile-btn { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; padding: 0.4rem 0.6rem; color: var(--text); }
.nav-mobile-btn svg { width: 20px; height: 20px; display: block; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.4rem; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; font-family: var(--font);
  cursor: pointer; border: none; transition: all var(--transition);
  text-align: center; white-space: nowrap; line-height: 1.4;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,0.25); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37,99,235,0.35); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; transform: translateY(-1px); }
.btn-danger { background: #FEE2E2; color: #DC2626; border: none; }
.btn-danger:hover { background: #FCA5A5; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.82rem; }
.btn-lg { padding: 0.85rem 1.8rem; font-size: 1rem; border-radius: var(--radius); }
.btn-icon { padding: 0.5rem; border-radius: 8px; }

/* ===== HERO ===== */
#hero {
  padding: 5rem 0 4rem;
  background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 50%, #ECFDF5 100%);
  position: relative; overflow: hidden;
}
[data-theme="dark"] #hero { background: linear-gradient(135deg, #1E293B 0%, #0F172A 50%, #064E3B10 100%); }
#hero::before {
  content: ''; position: absolute; top: -50%; right: -20%;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 0.4rem; background: #DBEAFE; color: var(--primary); border-radius: 999px; padding: 0.3rem 0.85rem; font-size: 0.78rem; font-weight: 600; margin-bottom: 1.25rem; }
[data-theme="dark"] .hero-badge { background: rgba(37,99,235,0.15); }
.hero-title { margin-bottom: 1rem; }
.hero-title span { color: var(--primary); }
.hero-subtitle { font-size: 1.1rem; margin-bottom: 2rem; max-width: 480px; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.hero-stats { display: flex; gap: 2rem; }
.hero-stat strong { display: block; font-size: 1.4rem; font-weight: 800; color: var(--text); }
.hero-stat span { font-size: 0.8rem; color: var(--text-muted); }
.hero-visual { position: relative; }
.hero-mockup {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  border: 1px solid var(--border);
  transform: rotate(2deg);
  transition: transform 0.3s ease;
}
.hero-mockup:hover { transform: rotate(0deg); }
.mockup-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.mockup-company { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.mockup-invoice-label { font-size: 0.75rem; color: var(--text-muted); text-align: right; }
.mockup-invoice-num { font-weight: 700; color: var(--primary); font-size: 0.9rem; }
.mockup-divider { height: 1px; background: var(--border); margin: 0.75rem 0; }
.mockup-table { width: 100%; font-size: 0.78rem; }
.mockup-table th { color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.05em; padding: 0.3rem 0; }
.mockup-table td { padding: 0.35rem 0; color: var(--text); }
.mockup-table td:last-child, .mockup-table th:last-child { text-align: right; }
.mockup-total { display: flex; justify-content: flex-end; }
.mockup-total-box { background: var(--primary); color: #fff; border-radius: 8px; padding: 0.5rem 0.85rem; text-align: right; }
.mockup-total-label { font-size: 0.7rem; opacity: 0.8; }
.mockup-total-amount { font-size: 1.1rem; font-weight: 800; }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; color: var(--text); }
.card-desc { font-size: 0.875rem; color: var(--text-muted); }

/* ===== INVOICE GENERATOR APP ===== */
#invoice-generator { background: var(--bg); padding: 3rem 0; }
.generator-header { text-align: center; margin-bottom: 2.5rem; }
.generator-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.form-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.form-tabs { display: flex; border-bottom: 1px solid var(--border); overflow-x: auto; }
.form-tab {
  flex: 1; min-width: 80px; padding: 0.85rem 0.5rem;
  background: none; border: none; cursor: pointer; font-size: 0.8rem;
  font-weight: 600; color: var(--text-muted); font-family: var(--font);
  transition: all var(--transition); border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.form-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: rgba(37,99,235,0.04); }
.form-tab:hover:not(.active) { color: var(--text); background: var(--bg); }
.tab-content { display: none; padding: 1.5rem; }
.tab-content.active { display: block; }

/* FORM ELEMENTS */
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text); margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.04em; }
input, select, textarea {
  width: 100%; padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.875rem; font-family: var(--font); color: var(--text);
  background: var(--surface); transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none; -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
textarea { resize: vertical; min-height: 80px; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.6rem center; padding-right: 2rem; }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { background: #0F172A; border-color: #334155; color: var(--text); }

/* Logo Upload */
.logo-upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius-sm);
  padding: 1.25rem; text-align: center; cursor: pointer;
  transition: all var(--transition); background: var(--bg);
}
.logo-upload-area:hover { border-color: var(--primary); background: rgba(37,99,235,0.02); }
.logo-upload-area.has-logo { border-style: solid; border-color: var(--success); }
.logo-preview { max-height: 60px; max-width: 160px; margin: 0 auto 0.5rem; border-radius: 4px; }
.logo-upload-text { font-size: 0.8rem; color: var(--text-muted); }
.logo-upload-text strong { color: var(--primary); }

/* Line Items */
.items-table-wrap { overflow-x: auto; margin-bottom: 1rem; }
.items-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.items-table thead th {
  text-align: left; padding: 0.5rem 0.4rem;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); border-bottom: 1px solid var(--border); background: var(--bg);
}
.items-table thead th:last-child { text-align: right; }
.items-table tbody tr { border-bottom: 1px solid var(--border); }
.items-table tbody tr:last-child { border-bottom: none; }
.items-table td { padding: 0.5rem 0.3rem; vertical-align: middle; }
.items-table input { border-radius: 6px; padding: 0.45rem 0.5rem; font-size: 0.82rem; }
.items-table .item-amount { text-align: right; font-weight: 600; color: var(--text); font-size: 0.85rem; white-space: nowrap; min-width: 70px; padding-right: 0.4rem; }
.col-desc { min-width: 130px; }
.col-qty { width: 64px; }
.col-price { width: 90px; }
.col-tax { width: 72px; }
.col-amount { width: 80px; }
.col-action { width: 36px; }
.btn-remove-item { background: #FEE2E2; color: #DC2626; border: none; border-radius: 6px; width: 28px; height: 28px; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: background var(--transition); }
.btn-remove-item:hover { background: #FCA5A5; }

/* Summary */
.totals-section { background: var(--bg); border-radius: var(--radius-sm); padding: 1rem; border: 1px solid var(--border); }
.total-row { display: flex; justify-content: space-between; align-items: center; padding: 0.3rem 0; font-size: 0.875rem; }
.total-row.subtotal { border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; margin-bottom: 0.2rem; }
.total-row.grand { padding-top: 0.5rem; border-top: 2px solid var(--border); font-size: 1rem; font-weight: 800; color: var(--text); margin-top: 0.2rem; }
.total-row span:first-child { color: var(--text-muted); }
.total-row span:last-child { font-weight: 600; color: var(--text); }
.total-row.grand span:last-child { color: var(--primary); font-size: 1.15rem; }

/* Discount & Tax */
.discount-group { display: flex; gap: 0.5rem; align-items: flex-end; }
.discount-group select { flex: 0 0 auto; width: 130px; }
.discount-group input { flex: 1; }

/* Template Selector */
.templates-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
.template-option { position: relative; cursor: pointer; }
.template-option input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.template-card {
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.6rem; text-align: center; transition: all var(--transition);
  background: var(--surface);
}
.template-option input:checked + .template-card { border-color: var(--primary); background: rgba(37,99,235,0.05); }
.template-card:hover { border-color: var(--accent); }
.template-swatch { height: 30px; border-radius: 4px; margin-bottom: 0.35rem; }
.template-name { font-size: 0.68rem; font-weight: 600; color: var(--text-muted); }
.template-option input:checked + .template-card .template-name { color: var(--primary); }

/* ===== PREVIEW PANEL ===== */
.preview-panel { position: sticky; top: 80px; }
.preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.preview-header h3 { font-size: 1rem; }
.preview-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.preview-scale-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.preview-scale-inner { transform-origin: top left; width: 794px; }
.preview-outer { overflow: hidden; }

/* ===== INVOICE PREVIEW DOCUMENT ===== */
.invoice-doc {
  width: 794px; min-height: 1000px; background: #fff; color: #0F172A;
  font-family: var(--font); padding: 48px;
  position: relative;
}
.invoice-doc.tpl-minimal { --doc-accent: #111827; }
.invoice-doc.tpl-corporate { --doc-accent: #6B7280; }
.invoice-doc.tpl-green { --doc-accent: #059669; }
.invoice-doc.tpl-blue { --doc-accent: #2563EB; }

.inv-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; }
.inv-logo-wrap img { max-height: 60px; max-width: 180px; }
.inv-logo-placeholder { font-size: 1.4rem; font-weight: 800; color: var(--doc-accent, #2563EB); }
.inv-title-block { text-align: right; }
.inv-title { font-size: 2rem; font-weight: 900; color: var(--doc-accent, #2563EB); text-transform: uppercase; letter-spacing: 0.05em; }
.inv-num { font-size: 0.85rem; color: #64748B; margin-top: 4px; }
.inv-date-block { text-align: right; margin-top: 8px; font-size: 0.8rem; color: #64748B; }
.inv-date-block strong { color: #0F172A; }

.inv-accent-bar { height: 3px; background: var(--doc-accent, #2563EB); border-radius: 2px; margin-bottom: 28px; }

.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.inv-party-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--doc-accent, #2563EB); margin-bottom: 6px; }
.inv-party-name { font-size: 1rem; font-weight: 700; color: #0F172A; margin-bottom: 4px; }
.inv-party-detail { font-size: 0.8rem; color: #64748B; line-height: 1.5; }

/* Items Table in Preview */
.inv-items { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.inv-items thead th {
  background: var(--doc-accent, #2563EB); color: #fff;
  padding: 10px 12px; text-align: left; font-size: 0.75rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.inv-items thead th:last-child { text-align: right; }
.inv-items.tpl-minimal thead th { background: #111827; }
.inv-items.tpl-corporate thead th { background: #374151; }
.inv-items.tpl-green thead th { background: #059669; }
.inv-items tbody tr:nth-child(even) { background: #F8FAFC; }
.inv-items tbody td { padding: 10px 12px; font-size: 0.83rem; color: #374151; border-bottom: 1px solid #E2E8F0; }
.inv-items tbody td:last-child { text-align: right; font-weight: 600; color: #0F172A; }
.inv-items tfoot td { padding: 8px 12px; font-size: 0.83rem; }
.inv-items tfoot .tfoot-label { color: #64748B; text-align: right; }
.inv-items tfoot .tfoot-value { font-weight: 600; text-align: right; }
.inv-items tfoot .grand-total-row td { border-top: 2px solid #E2E8F0; background: rgba(37,99,235,0.04); }
.inv-items tfoot .grand-total-row .tfoot-label { font-weight: 700; font-size: 0.9rem; color: #0F172A; }
.inv-items tfoot .grand-total-row .tfoot-value { font-weight: 800; font-size: 1rem; color: var(--doc-accent, #2563EB); }

.inv-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.inv-notes { background: #F8FAFC; border-left: 3px solid var(--doc-accent, #2563EB); padding: 12px 16px; border-radius: 4px; }
.inv-notes-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--doc-accent, #2563EB); margin-bottom: 4px; }
.inv-notes-text { font-size: 0.78rem; color: #64748B; line-height: 1.5; }
.inv-payment { background: #F8FAFC; border-radius: 8px; padding: 12px 16px; }
.inv-payment-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--doc-accent, #2563EB); margin-bottom: 8px; }
.inv-payment-row { display: flex; justify-content: space-between; font-size: 0.78rem; padding: 2px 0; }
.inv-payment-row span:first-child { color: #64748B; }
.inv-payment-row span:last-child { font-weight: 600; color: #0F172A; }
.inv-footer { margin-top: 32px; text-align: center; font-size: 0.75rem; color: #94A3B8; border-top: 1px solid #E2E8F0; padding-top: 16px; }

/* Template overrides */
.tpl-minimal .inv-title { color: #111827; }
.tpl-minimal .inv-party-label, .tpl-minimal .inv-notes-label, .tpl-minimal .inv-payment-label { color: #111827; }
.tpl-minimal .inv-notes { border-color: #111827; }
.tpl-corporate .inv-title { color: #6B7280; }
.tpl-corporate .inv-party-label, .tpl-corporate .inv-notes-label, .tpl-corporate .inv-payment-label { color: #6B7280; }
.tpl-corporate .inv-notes { border-color: #6B7280; }
.tpl-green .inv-title { color: #059669; }
.tpl-green .inv-party-label, .tpl-green .inv-notes-label, .tpl-green .inv-payment-label { color: #059669; }
.tpl-green .inv-notes { border-color: #059669; }
.tpl-green .grand-total-row .tfoot-value { color: #059669; }

/* ===== FEATURES SECTION ===== */
#features { background: var(--surface); }
.feature-card { display: flex; flex-direction: column; gap: 0.75rem; }
.feature-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(59,130,246,0.15)); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feature-icon svg { width: 24px; height: 24px; color: var(--primary); }

/* ===== CONTENT SECTIONS ===== */
#content-sections { background: var(--bg); }
.content-block { max-width: 780px; margin: 0 auto; }
.content-block + .content-block { margin-top: 3.5rem; padding-top: 3.5rem; border-top: 1px solid var(--border); }
.content-block h2 { margin-bottom: 1.25rem; }
.content-block p { margin-bottom: 1rem; font-size: 0.975rem; line-height: 1.75; }
.content-block p:last-child { margin-bottom: 0; }
.how-steps { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1.5rem; }
.how-step { display: flex; gap: 1rem; align-items: flex-start; }
.step-num { width: 32px; height: 32px; background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; flex-shrink: 0; margin-top: 2px; }
.step-text h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.step-text p { font-size: 0.875rem; margin: 0; }

/* ===== FAQ ===== */
#faq { background: var(--surface); }
.faq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0; }
.faq-item { border: 1px solid var(--border); border-radius: 0; margin: -1px 0 0 -1px; }
.faq-item:first-child { border-radius: var(--radius) 0 0 0; }
.faq-question {
  width: 100%; padding: 1.1rem 1.25rem; background: none; border: none;
  text-align: left; font-size: 0.9rem; font-weight: 600; color: var(--text);
  cursor: pointer; font-family: var(--font); display: flex; justify-content: space-between; gap: 0.75rem;
  transition: background var(--transition), color var(--transition);
}
.faq-question:hover { background: var(--bg); color: var(--primary); }
.faq-question[aria-expanded="true"] { color: var(--primary); background: rgba(37,99,235,0.03); }
.faq-icon { width: 18px; height: 18px; flex-shrink: 0; transition: transform 0.2s; fill: currentColor; margin-top: 1px; }
.faq-question[aria-expanded="true"] .faq-icon { transform: rotate(45deg); }
.faq-answer { padding: 0 1.25rem; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.2s; }
.faq-answer.open { max-height: 200px; padding: 0 1.25rem 1.1rem; }
.faq-answer p { font-size: 0.875rem; color: var(--text-muted); margin: 0; }

/* ===== FOOTER ===== */
footer {
  background: #0F172A; color: #94A3B8; padding: 3rem 0 1.5rem;
}
[data-theme="dark"] footer { background: #020617; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2.5rem; }
.footer-brand .nav-logo { color: #fff; margin-bottom: 0.75rem; }
.footer-brand p { font-size: 0.875rem; max-width: 260px; }
.footer-col h4 { color: #fff; font-size: 0.85rem; font-weight: 700; margin-bottom: 0.85rem; }
.footer-col ul { list-style: none; }
.footer-col ul li + li { margin-top: 0.5rem; }
.footer-col a { color: #94A3B8; font-size: 0.85rem; transition: color var(--transition); }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1E293B; padding-top: 1.5rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; }
.footer-bottom p { font-size: 0.8rem; }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  background: var(--text); color: var(--bg); padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500;
  box-shadow: var(--shadow-lg); animation: slideIn 0.25s ease; display: flex; align-items: center; gap: 0.5rem;
}
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: #DC2626; color: #fff; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { to { transform: translateX(120%); opacity: 0; } }

/* ===== SECTION HEADINGS ===== */
.section-label { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--primary); margin-bottom: 0.5rem; }
.section-heading { margin-bottom: 0.75rem; }
.section-sub { max-width: 520px; margin: 0 auto; text-align: center; }
.text-center { text-align: center; }

/* ===== MOBILE NAV ===== */
.mobile-nav { display: none; position: fixed; top: 64px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); z-index: 999; padding: 1rem; flex-direction: column; gap: 0.25rem; }
.mobile-nav.open { display: flex; }
.mobile-nav a { padding: 0.65rem 1rem; border-radius: 8px; font-weight: 500; color: var(--text); transition: background var(--transition); }
.mobile-nav a:hover { background: var(--bg); }

/* ===== PRINT STYLES ===== */
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  .invoice-doc { box-shadow: none !important; border: none !important; width: 100% !important; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .generator-layout { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .preview-scale-inner { width: 100% !important; transform: none !important; }
  .invoice-doc { width: 100% !important; font-size: 12px; }
  .inv-parties { grid-template-columns: 1fr; gap: 16px; }
  .inv-bottom { grid-template-columns: 1fr; }
  .inv-header { flex-direction: column; gap: 12px; }
  .inv-title-block { text-align: left; }
  .inv-date-block { text-align: left; }
}

@media (max-width: 768px) {
  .hero-content { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .nav-links { display: none; }
  .nav-mobile-btn { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
  .templates-grid { grid-template-columns: repeat(2, 1fr); }
  .faq-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .form-row-3 { grid-template-columns: 1fr; }
  .preview-actions { justify-content: stretch; }
  .preview-actions .btn { flex: 1; justify-content: center; }
}

/* Utility */
.hidden { display: none !important; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }