/* ============================================
   Freelancer Proposal Generator - Design System
   Color: Violet #8b5cf6
   ============================================ */

:root {
  --color-bg: #ffffff;
  --color-surface: #f8f9fa;
  --color-text: #1a1a2e;
  --color-text-muted: #6b7280;
  --color-text-faint: #9ca3af;
  --color-primary: #8b5cf6;
  --color-primary-light: #a78bfa;
  --color-primary-dark: #7c3aed;
  --color-success: #047857;
  --color-warning: #9a5400;
  --color-error: #dc2626;
  --color-border: #e5e7eb;
  --radius: 12px;
  --max-width: 1100px;
}

[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-text-faint: #64748b;
  --color-primary: #a78bfa;
  --color-primary-light: #c4b5fd;
  --color-primary-dark: #8b5cf6;
  --color-success: #10b981;
  --color-warning: #fbbf24;
  --color-error: #f87171;
  --color-border: #334155;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; top: -100%; left: 1rem;
  background: var(--color-primary); color: #fff;
  padding: 0.5rem 1rem; border-radius: var(--radius);
  z-index: 1000; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* ---------- Announcement Bar ---------- */
.announcement-bar {
  background: #111827; color: rgba(255,255,255,0.85);
  text-align: center; padding: 0.5rem 1rem;
  font-size: 0.785rem; font-weight: 400;
  letter-spacing: 0.01em; line-height: 1.4;
}
.announcement-bar strong { font-weight: 600; color: #fff; }
.announcement-bar .ann-cta {
  color: #c4b5fd; text-decoration: underline;
  text-underline-offset: 2px; font-weight: 500; margin-left: 0.35rem;
}
.announcement-bar .ann-cta:hover { color: #fff; }
.announcement-bar .ann-sep { margin: 0 0.4rem; opacity: 0.35; }
[data-theme="dark"] .announcement-bar { background: #1e293b; }
[data-theme="dark"] .announcement-bar .ann-cta { color: #c4b5fd; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}
.header-inner {
  max-width: var(--max-width); margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { font-weight: 800; font-size: 1.2rem; color: var(--color-text); }
.logo:hover { text-decoration: none; }
.nav-links {
  list-style: none; display: flex; align-items: center; gap: 1.5rem;
}
.nav-links a { color: var(--color-text-muted); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a.active { color: var(--color-primary); text-decoration: none; }

/* ---------- Mobile menu ---------- */
.mobile-toggle {
  display: none; background: none; border: none;
  font-size: 1.5rem; color: var(--color-text); cursor: pointer;
}
@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .nav-links {
    display: none; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--color-bg); border-bottom: 1px solid var(--color-border);
    padding: 1rem; gap: 0.75rem;
  }
  .nav-links.open { display: flex; }
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  background: none; border: 1px solid var(--color-border);
  border-radius: 50%; width: 2rem; height: 2rem;
  cursor: pointer; color: var(--color-text); font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Hero ---------- */
.hero {
  padding: 3rem 1.5rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.hero .subtitle {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

/* ---------- Wizard ---------- */
.wizard-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}
.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.wizard-step-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-faint);
  transition: color 0.2s;
}
.wizard-step-indicator.active { color: var(--color-primary); }
.wizard-step-indicator.completed { color: var(--color-success); }
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--color-border);
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.2s;
}
.wizard-step-indicator.active .step-num {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.wizard-step-indicator.completed .step-num {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}
.step-connector {
  width: 30px;
  height: 2px;
  background: var(--color-border);
  margin: 0 0.25rem;
}
.step-connector.completed { background: var(--color-success); }
@media (max-width: 768px) {
  .wizard-step-indicator .step-label { display: none; }
  .step-connector { width: 16px; }
}

.wizard-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  display: none;
}
.wizard-panel.active { display: block; }
.wizard-panel h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.wizard-panel .panel-desc {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* ---------- Form controls ---------- */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
}
.form-group select,
.form-group input[type="number"],
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group input[type="file"],
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.95rem;
  font-family: inherit;
}
.form-group textarea {
  min-height: 100px;
  resize: vertical;
}
.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
  border-color: var(--color-primary);
}
.form-group .hint {
  font-size: 0.75rem;
  color: var(--color-text-faint);
  margin-top: 0.2rem;
}

/* ---------- Toggle group ---------- */
.toggle-group {
  display: flex;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.toggle-btn {
  flex: 1;
  padding: 0.6rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--color-bg);
  color: var(--color-text-muted);
  border: none;
  border-right: 1px solid var(--color-border);
  transition: background 0.15s, color 0.15s;
}
.toggle-btn:last-child { border-right: none; }
.toggle-btn.active {
  background: var(--color-primary);
  color: #fff;
}
.toggle-btn:hover:not(.active) {
  background: var(--color-surface);
}

/* ---------- Dynamic list ---------- */
.dynamic-list {
  list-style: none;
  margin-bottom: 1rem;
}
.dynamic-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
.dynamic-list li .item-content { flex: 1; }
.dynamic-list li .item-content input,
.dynamic-list li .item-content textarea {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.85rem;
  font-family: inherit;
  margin-bottom: 0.35rem;
}
.dynamic-list li .item-content textarea {
  min-height: 50px;
  resize: vertical;
}
.dynamic-list .item-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.btn-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.btn-icon:hover { background: var(--color-border); }
.btn-icon.danger:hover { background: var(--color-error); color: #fff; }

.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--color-bg);
  border: 1px dashed var(--color-primary);
  border-radius: 8px;
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-add:hover { background: color-mix(in srgb, var(--color-primary) 8%, var(--color-bg)); }

/* ---------- Checkbox toggle ---------- */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.checkbox-group input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}
.checkbox-group label {
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 0;
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  text-decoration: none;
  color: #fff;
}
.btn-secondary {
  display: inline-block;
  background: var(--color-surface);
  color: var(--color-text);
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover {
  background: var(--color-border);
  text-decoration: none;
}
.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

/* ---------- Proposal Preview ---------- */
.proposal-preview {
  background: #fff;
  color: #1a1a2e;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 800px;
  margin: 0 auto;
}
[data-theme="dark"] .proposal-preview {
  background: #1e293b;
  color: #f1f5f9;
}
.proposal-cover {
  text-align: center;
  padding-bottom: 2rem;
  border-bottom: 2px solid #8b5cf6;
  margin-bottom: 2rem;
}
.proposal-cover .logo-preview {
  max-height: 60px;
  margin-bottom: 1rem;
}
.proposal-cover h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.proposal-cover .project-title {
  font-size: 1.1rem;
  color: #6b7280;
}
.proposal-cover .date-line {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-top: 0.5rem;
}
.proposal-section {
  margin-bottom: 1.5rem;
}
.proposal-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #8b5cf6;
}
[data-theme="dark"] .proposal-section h3 { color: #a78bfa; }
.proposal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.proposal-table th,
.proposal-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}
[data-theme="dark"] .proposal-table th,
[data-theme="dark"] .proposal-table td {
  border-color: #334155;
}
.proposal-table th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6b7280;
}
.proposal-table .total-row {
  font-weight: 700;
  border-top: 2px solid #8b5cf6;
}
.proposal-table .total-row td { padding-top: 0.75rem; }
.signature-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}
[data-theme="dark"] .signature-section { border-color: #334155; }
.signature-block .sig-label {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 2rem;
}
.signature-block .sig-line {
  border-top: 1px solid #1a1a2e;
  padding-top: 0.35rem;
  font-size: 0.85rem;
}
[data-theme="dark"] .signature-block .sig-line { border-color: #94a3b8; }

.preview-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* ---------- Info sections ---------- */
.info-section {
  max-width: var(--max-width);
  margin: 3rem auto;
  padding: 0 1.5rem;
}
.info-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.info-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.info-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.info-card p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ---------- Template cards ---------- */
.template-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.template-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--color-primary);
}
.template-card h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin: 1rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.template-card ul {
  list-style: none;
  margin-bottom: 0.5rem;
}
.template-card ul li {
  padding: 0.25rem 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.template-card ul li::before {
  content: "- ";
  color: var(--color-primary);
  font-weight: 700;
}

/* ---------- Content pages ---------- */
.content-page {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}
.content-page h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
}
.content-page h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
}
.content-page h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}
.content-page p {
  margin-bottom: 1rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}
.content-page ul, .content-page ol {
  margin: 0 0 1rem 1.5rem;
  color: var(--color-text-muted);
}
.content-page li { margin-bottom: 0.35rem; }

/* ---------- Comparison table ---------- */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.comparison-table th,
.comparison-table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}
.comparison-table th {
  font-weight: 600;
  background: var(--color-surface);
}
.comparison-table .check { color: var(--color-success); font-weight: 700; }
.comparison-table .cross { color: var(--color-error); }

/* ---------- FAQ ---------- */
.faq-section { max-width: 700px; margin: 3rem auto; padding: 0 1.5rem; }
.faq-item { border-bottom: 1px solid var(--color-border); padding: 1rem 0; }
.faq-item summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq-item summary::before { content: "+ "; color: var(--color-primary); }
.faq-item[open] summary::before { content: "- "; }
.faq-answer { margin-top: 0.5rem; color: var(--color-text-muted); }

/* ---------- Social proof ---------- */
.testimonials {
  max-width: var(--max-width);
  margin: 3rem auto;
  padding: 0 1.5rem;
}
.testimonials h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.testimonial-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.testimonial-card .quote {
  font-style: italic;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
}
.testimonial-card .author {
  font-weight: 600;
  font-size: 0.85rem;
}
.testimonial-card .role {
  font-size: 0.8rem;
  color: var(--color-text-faint);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 4rem; padding: 2rem 1.5rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}
.footer-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 2rem;
}
.footer-brand { flex: 2; min-width: 200px; }
.footer-brand h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.footer-brand p { color: var(--color-text-muted); font-size: 0.9rem; }
.footer-links { flex: 1; min-width: 120px; }
.footer-links h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 0.35rem; }
.footer-links a { color: var(--color-text-muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--color-primary); }

/* ---------- Cross-sell ---------- */
.footer-products {
  max-width: var(--max-width); margin: 1.5rem auto 0;
  padding-top: 1rem; border-top: 1px solid var(--color-border);
  text-align: center;
}
.footer-products h4 {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--color-text-muted); margin-bottom: 0.5rem;
}
.footer-products-list {
  list-style: none; display: flex; flex-wrap: wrap;
  gap: 0.5rem 1.5rem; justify-content: center; font-size: 0.85rem;
}
.footer-products-list a { color: var(--color-text-muted); }
.footer-products-list a:hover { color: var(--color-primary); }
.product-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; margin-right: 0.35rem;
}

/* ---------- Footer bottom ---------- */
.footer-bottom {
  max-width: var(--max-width); margin: 1rem auto 0;
  text-align: center; font-size: 0.85rem; color: var(--color-text-muted);
}

/* ---------- Success page ---------- */
.success-page {
  text-align: center;
  padding: 4rem 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}
.success-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}
.success-page h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
}
.success-page p {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

/* ---------- Scroll reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity 0.5s, transform 0.5s; }
[data-reveal].visible { opacity: 1; transform: translateY(0); }

/* ---------- Utility ---------- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
/* ---------- Trust badges ---------- */
.trust-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem 0;
  flex-wrap: wrap;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.trust-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
  flex-shrink: 0;
}

/* ---------- Print styles ---------- */
@media print {
  .announcement-bar,
  .site-header,
  .site-footer,
  .mobile-toggle,
  .theme-toggle,
  .skip-link,
  .wizard-nav,
  .wizard-progress,
  .preview-actions,
  .trust-badges,
  .testimonials,
  .faq-section,
  .info-section {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
    line-height: 1.5;
  }

  .wizard-container {
    padding: 0;
    max-width: 100%;
  }

  .wizard-panel { display: none !important; }
  .wizard-panel#step-6 { display: block !important; }

  .proposal-preview {
    border: none;
    box-shadow: none;
    padding: 0;
  }

  @page {
    margin: 1.5cm;
  }
}

.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
