/* InvoiceForge - Professional Invoice Generator */
/* Design System: Dark professional theme */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-input: #16162a;
  --border: #2a2a4a;
  --border-focus: #6c5ce7;
  --text-primary: #e8e8f0;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a82;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-glow: rgba(108, 92, 231, 0.3);
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #e17055;
  --gradient-primary: linear-gradient(135deg, #6c5ce7, #a29bfe);
  --gradient-hero: linear-gradient(180deg, #0a0a0f 0%, #16162a 100%);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

/* Typography */
h1, h2, h3, h4, h5, h6 { line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.75rem); }

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 1.5rem; }

.nav a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition);
}
.nav a:hover { color: var(--text-primary); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--accent-light);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-card);
  border-color: var(--accent);
}

.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }

.btn-pro {
  background: linear-gradient(135deg, #f39c12, #e74c3c);
  color: #fff;
}
.btn-pro:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(243, 156, 18, 0.3);
  color: #fff;
}

/* Hero */
.hero {
  padding: 5rem 0 3rem;
  text-align: center;
  background: var(--gradient-hero);
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.hero h1 { margin-bottom: 1rem; }
.hero h1 .highlight { color: var(--accent-light); }

.hero p {
  color: var(--text-secondary);
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.trust-badges {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.trust-badge {
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Invoice Generator */
.generator {
  padding: 4rem 0;
}

.generator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.form-card, .preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.form-card h2, .preview-card h2 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.form-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.form-section h3 {
  font-size: 1rem;
  color: var(--accent-light);
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-group input[type="file"] { padding: 0.5rem; }

/* Line Items */
.line-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.line-items-table th {
  text-align: left;
  padding: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.line-items-table td { padding: 0.4rem; }

.line-items-table input {
  width: 100%;
  padding: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
}

.line-items-table input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.line-items-table .col-desc { width: 40%; }
.line-items-table .col-qty { width: 15%; }
.line-items-table .col-rate { width: 20%; }
.line-items-table .col-amount { width: 20%; }
.line-items-table .col-action { width: 5%; }

.btn-remove-row {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.3rem;
  opacity: 0.6;
  transition: opacity var(--transition);
}
.btn-remove-row:hover { opacity: 1; }

.btn-add-row {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--accent-light);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  width: 100%;
  transition: all var(--transition);
}
.btn-add-row:hover {
  border-color: var(--accent);
  background: rgba(108, 92, 231, 0.05);
}

/* Totals */
.totals {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.total-row {
  display: flex;
  justify-content: space-between;
  width: 250px;
  font-size: 0.95rem;
}

.total-row.grand-total {
  font-weight: 700;
  font-size: 1.1rem;
  padding-top: 0.5rem;
  border-top: 2px solid var(--border);
  color: var(--accent-light);
}

/* Invoice Preview */
.invoice-preview {
  background: #fff;
  color: #333;
  border-radius: var(--radius-sm);
  padding: 2rem;
  min-height: 400px;
  font-size: 0.85rem;
}

.invoice-preview .inv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #6c5ce7;
}

.invoice-preview .inv-company { font-weight: 700; font-size: 1.1rem; color: #1a1a2e; }
.invoice-preview .inv-company-details { font-size: 0.8rem; color: #666; margin-top: 0.3rem; }

.invoice-preview .inv-title { text-align: right; }
.invoice-preview .inv-title h2 { color: #6c5ce7; font-size: 1.5rem; margin: 0; }
.invoice-preview .inv-title p { color: #666; font-size: 0.85rem; }

.invoice-preview .inv-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.invoice-preview .inv-info h4 { font-size: 0.75rem; text-transform: uppercase; color: #999; margin-bottom: 0.3rem; }
.invoice-preview .inv-info p { margin: 0.1rem 0; }

.invoice-preview table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.invoice-preview table th {
  background: #f8f8fc;
  padding: 0.6rem;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #666;
  border-bottom: 2px solid #e0e0e0;
}

.invoice-preview table td {
  padding: 0.6rem;
  border-bottom: 1px solid #f0f0f0;
}

.invoice-preview table td:last-child,
.invoice-preview table th:last-child { text-align: right; }

.invoice-preview .inv-totals { text-align: right; }
.invoice-preview .inv-totals .row { display: flex; justify-content: flex-end; gap: 2rem; margin-bottom: 0.3rem; }
.invoice-preview .inv-totals .row span:first-child { color: #666; }
.invoice-preview .inv-totals .grand { font-weight: 700; font-size: 1.1rem; color: #6c5ce7; border-top: 2px solid #e0e0e0; padding-top: 0.5rem; }

.invoice-preview .inv-notes { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #e0e0e0; font-size: 0.8rem; color: #888; }

.invoice-preview .inv-logo img { max-height: 60px; max-width: 200px; }

/* Generate Button Area */
.generate-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Pro Banner */
.pro-banner {
  background: linear-gradient(135deg, rgba(243, 156, 18, 0.1), rgba(231, 76, 60, 0.1));
  border: 1px solid rgba(243, 156, 18, 0.3);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin: 3rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.pro-banner-text h3 { color: var(--warning); font-size: 1.2rem; }
.pro-banner-text p { color: var(--text-secondary); font-size: 0.95rem; margin-top: 0.3rem; }

/* Features Section */
.features {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}

.features h2 { text-align: center; margin-bottom: 3rem; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all var(--transition);
}

.feature-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--gradient-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; }

/* Pro Page */
.pro-hero {
  padding: 5rem 0 3rem;
  text-align: center;
  background: linear-gradient(180deg, #0a0a0f, #1a0f0a);
}

.pro-hero .badge {
  display: inline-block;
  background: linear-gradient(135deg, #f39c12, #e74c3c);
  color: #fff;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.price-tag {
  font-size: 3rem;
  font-weight: 800;
  margin: 1.5rem 0 0.5rem;
}
.price-tag .currency { font-size: 1.5rem; vertical-align: super; }
.price-tag .period { font-size: 1rem; color: var(--text-muted); font-weight: 400; }

.pro-features-list {
  list-style: none;
  max-width: 500px;
  margin: 2rem auto;
  text-align: left;
}

.pro-features-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
}

.pro-features-list li::before {
  content: '\2713';
  color: var(--success);
  font-weight: 700;
  font-size: 1.1rem;
}

/* FAQ */
.faq { padding: 4rem 0; }
.faq h2 { text-align: center; margin-bottom: 2.5rem; }

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  overflow: hidden;
}

.faq-question {
  padding: 1.2rem 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  transition: background var(--transition);
}

.faq-question:hover { background: rgba(108, 92, 231, 0.05); }

.faq-question .icon {
  transition: transform var(--transition);
  font-size: 1.2rem;
  color: var(--text-muted);
}

.faq-item.open .faq-question .icon { transform: rotate(45deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer-inner {
  padding: 0 1.5rem 1.2rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.faq-item.open .faq-answer { max-height: 300px; }

/* CTA Section */
.cta-section {
  padding: 4rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

.cta-section h2 { margin-bottom: 1rem; }
.cta-section p { color: var(--text-secondary); margin-bottom: 2rem; max-width: 500px; margin-left: auto; margin-right: auto; }

/* Footer */
.footer {
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.5rem; }

.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.footer-col a {
  display: block;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0.3rem 0;
}
.footer-col a:hover { color: var(--accent-light); }

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Landing Pages */
.landing-hero {
  padding: 5rem 0 3rem;
  text-align: center;
  background: var(--gradient-hero);
}

.landing-hero h1 { margin-bottom: 1rem; }
.landing-hero p { color: var(--text-secondary); font-size: 1.15rem; max-width: 650px; margin: 0 auto 2rem; }

.landing-content { padding: 4rem 0; }

.landing-content h2 { margin-bottom: 1.5rem; }
.landing-content p, .landing-content li { color: var(--text-secondary); margin-bottom: 1rem; }

.landing-content ul { list-style: none; padding: 0; }
.landing-content ul li { padding-left: 1.5rem; position: relative; }
.landing-content ul li::before { content: '\2713'; position: absolute; left: 0; color: var(--success); font-weight: 700; }

.content-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  align-items: start;
}

.content-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  position: sticky;
  top: 5rem;
}

.content-sidebar h3 { margin-bottom: 1rem; font-size: 1.1rem; }

/* Success/Cancel Pages */
.status-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.status-icon { font-size: 4rem; margin-bottom: 1rem; }
.status-page h1 { margin-bottom: 1rem; }
.status-page p { color: var(--text-secondary); margin-bottom: 2rem; max-width: 500px; }

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .generator-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .content-sidebar { position: static; }
}

@media (max-width: 768px) {
  .nav { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-primary); border-bottom: 1px solid var(--border); padding: 1rem 1.5rem; }
  .nav.open { display: flex; }
  .nav-toggle { display: block; }
  .features-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero { padding: 3rem 0 2rem; }
  .pro-banner { flex-direction: column; text-align: center; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; align-items: center; }
  .invoice-preview { padding: 1rem; font-size: 0.75rem; }
}

@media (max-width: 480px) {
  .line-items-table { font-size: 0.8rem; }
  .line-items-table .col-desc { width: 35%; }
  .total-row { width: 100%; }
}
