:root {
  /* High-end SaaS Light Theme Palette */
  --color-bg-main: #ffffff;
  --color-bg-secondary: #f8f9fa;
  --color-bg-card: #ffffff;
  --color-brand-blue: #0f172a; /* Deep blue/slate for text & accents */
  --color-accent-blue: #2563eb; /* Vibrant blue for primary actions */
  --color-accent-hover: #1d4ed8;
  --color-text-primary: #1e293b;
  --color-text-secondary: #64748b;
  --color-border: #e2e8f0;
  --color-input-bg: #ffffff;
  --color-white: #ffffff;
  --color-success: #10b981;
  --color-error: #ef4444;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  --font-primary: "Inter", sans-serif;
  --color-hero-gradient-start: #f1f5f9;
}

body.dark-mode {
  --color-bg-main: #0f172a;
  --color-bg-secondary: #0f172a; /* Unified background as requested */
  --color-bg-card: #1e293b;
  --color-brand-blue: #f8fafc; /* Invert for dark mode */
  --color-text-primary: #f1f5f9;
  --color-text-secondary: #cbd5e1;
  --color-border: #334155;
  --color-input-bg: #0f172a;
  --color-white: #1e293b; /* Re-map white to dark card bg in some contexts, or keep unique variable */
  
  /* Adjust shadows for dark mode */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  
  --color-hero-gradient-start: transparent; /* Disable light gradient in dark mode */
}

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

body {
  font-family: var(--font-primary);
  background-color: var(--color-bg-main);
  color: var(--color-text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

.app-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Header */
.main-header {
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-brand-blue);
  letter-spacing: -0.03em;
}

.logo .highlight {
  color: var(--color-accent-blue);
}

.logo a {
  text-decoration: none;
  color: inherit; 
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--color-accent-blue);
    margin-bottom: 2rem;
    font-weight: 500;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* Content Wrapper */
.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Common Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }

/* 
   ----------------
   HERO & CONVERTER 
   ----------------
*/
.hero-section {
  padding: 4rem 0;
  text-align: center;
  background: radial-gradient(circle at top, var(--color-hero-gradient-start) 0%, transparent 70%);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--color-brand-blue);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.text-highlight {
  color: var(--color-accent-blue);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto 3rem;
}

/* Converter Card */
.upload-container {
  max-width: 640px;
  margin: 0 auto;
}

.drop-zone {
  background: var(--color-bg-card);
  border: 2px dashed var(--color-border);
  border-radius: 24px;
  padding: 4rem 2rem;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--color-accent-blue);
  background: var(--color-bg-secondary);
}

.icon-wrapper svg {
  stroke: var(--color-accent-blue);
}
.icon-wrapper path[stroke="#C4C9CF"] { /* The cloud icon outline */
    stroke: var(--color-text-secondary);
}

.drop-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-brand-blue);
  margin-bottom: 0.5rem;
}

.drop-subtitle {
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
}

.browse-link {
  color: var(--color-accent-blue);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}

/* ── Upload Progress (Phase 1) ── */
.upload-progress { padding: 1.5rem 0; }

.up-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
}

.up-file-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.up-pdf-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--color-accent-blue);
}

.file-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.up-percent {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-accent-blue);
    white-space: nowrap;
}

.up-status {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    text-align: center;
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: var(--color-bg-secondary);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent-blue), #60a5fa);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 999px;
}

/* ── Conversion Processing (Phase 2) ── */
.conversion-state {
    padding: 2.5rem 1rem;
    text-align: center;
    animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.proc-header {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 1.75rem;
}

.proc-pulse-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 3px solid var(--color-accent-blue);
    opacity: 0;
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0%   { transform: scale(0.85); opacity: 0.6; }
    100% { transform: scale(1.3);  opacity: 0; }
}

.proc-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--color-accent-blue) 12%, var(--color-bg-card));
    border: 1.5px solid color-mix(in srgb, var(--color-accent-blue) 25%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: spinSlow 3s linear infinite;
}

.proc-icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--color-accent-blue);
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.proc-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-brand-blue);
    margin-bottom: 0.5rem;
}

.proc-step {
    font-size: 0.9rem;
    color: var(--color-accent-blue);
    font-weight: 500;
    margin-bottom: 1.25rem;
    min-height: 1.3em;
    transition: opacity 0.4s ease;
}

.proc-bar-track {
    width: 100%;
    max-width: 320px;
    height: 5px;
    background: var(--color-bg-secondary);
    border-radius: 999px;
    overflow: hidden;
    margin: 0 auto 0.75rem;
}

.proc-bar-indeterminate {
    height: 100%;
    width: 45%;
    background: linear-gradient(90deg, transparent, var(--color-accent-blue), transparent);
    border-radius: 999px;
    animation: indeterminate 1.6s ease-in-out infinite;
}

@keyframes indeterminate {
    0%   { transform: translateX(-120%); }
    100% { transform: translateX(310%); }
}

.proc-timer {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    font-variant-numeric: tabular-nums;
}

.proc-note {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    opacity: 0.7;
    max-width: 300px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Format Selection */
.format-selection { padding: 2rem 0; }
.format-title { font-size: 1.25rem; font-weight: 600; color: var(--color-brand-blue); margin-bottom: 1.5rem; }
.format-options { display: flex; justify-content: center; gap: 1rem; margin-bottom: 2rem; }
.format-option {
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    width: 130px;
    transition: all 0.2s;
    background: var(--color-bg-card);
}
.format-option:hover { border-color: var(--color-text-secondary); }
.format-option.active {
    border-color: var(--color-accent-blue);
    background: color-mix(in srgb, var(--color-accent-blue) 10%, var(--color-bg-card)); /* Modern CSS for tinting */
}
.format-icon {
    width: 40px; height: 40px; border-radius: 8px;
    background: #2b5797; color: white; display: flex;
    align-items: center; justify-content: center; font-size: 1.25rem;
    font-weight: bold; margin: 0 auto 0.5rem;
}
.format-icon.excel { background: #217346; }
.format-name { font-weight: 600; color: var(--color-text-primary); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.75rem 1.5rem; border-radius: 8px; font-weight: 600;
    transition: all 0.2s; border: none; cursor: pointer; font-size: 1rem;
}
.btn-primary {
    background: var(--color-accent-blue); color: white; text-decoration: none;
}
.btn-primary:hover {
    background: var(--color-accent-hover); transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-text {
    background: none; color: var(--color-text-secondary);
    text-decoration: underline; padding: 0.5rem; margin-top: 1rem;
}
.btn-text:hover { color: var(--color-brand-blue); }

/* old spinner removed — replaced by proc-icon above */
.status-text { font-size: 1.125rem; color: var(--color-brand-blue); font-weight: 500; }
.success-icon {
    width: 56px; height: 56px; background: #dcfce7; color: #15803d;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.75rem; margin: 0 auto 1rem;
}
.success-text {
    font-size: 1.25rem; font-weight: 600; color: var(--color-brand-blue); margin-bottom: 2rem;
}

/* 
   ----------------
   LANDING SECTIONS 
   ----------------
*/
.section-title {
    font-size: 2rem; font-weight: 700; color: var(--color-brand-blue);
    text-align: center; margin-bottom: 3rem;
}

/* Feature Grid */
.features-section { padding: 4rem 0; }
.feature-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.feature-card {
    padding: 2rem; border: 1px solid var(--color-border); border-radius: 16px;
    background: var(--color-bg-card); transition: all 0.2s;
}
.feature-card:hover { 
    transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent;
}
.feature-icon {
    font-size: 2rem; margin-bottom: 1.5rem; color: var(--color-accent-blue);
}
.feature-title { font-size: 1.25rem; font-weight: 700; color: var(--color-brand-blue); margin-bottom: 1rem; }
.feature-desc { color: var(--color-text-secondary); line-height: 1.6; }

/* Trust Section */
.trust-section { background: var(--color-bg-secondary); padding: 5rem 0; text-align: center; }
.trust-grid {
    display: flex; justify-content: center; gap: 4rem; flex-wrap: wrap;
    margin-top: 3rem;
}
.trust-item h3 { font-size: 2.5rem; font-weight: 800; color: var(--color-brand-blue); margin-bottom: 0.5rem; }
.trust-item p { color: var(--color-text-secondary); font-weight: 500; }

/* Stepper */
.stepper-section { padding: 6rem 0; }
.stepper-container {
    display: flex; justify-content: space-between; position: relative;
    max-width: 900px; margin: 0 auto;
}
.stepper-container::before {
    content: ''; position: absolute; top: 24px; left: 0; right: 0;
    height: 2px; background: var(--color-border); z-index: 0;
}
.step-item { position: relative; z-index: 1; text-align: center; background: var(--color-bg-main); padding: 0 1rem; width: 30%; }
.step-badge {
    width: 50px; height: 50px; background: var(--color-accent-blue);
    color: white; border-radius: 50%; font-size: 1.25rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem;
    box-shadow: 0 0 0 8px var(--color-bg-main);
}
.step-title { font-weight: 700; color: var(--color-brand-blue); margin-bottom: 0.5rem; }
.step-desc { font-size: 0.9rem; color: var(--color-text-secondary); }

/* FAQ */
.faq-section { max-width: 800px; margin: 0 auto; padding-bottom: 6rem; }
.faq-item { border-bottom: 1px solid var(--color-border); padding: 1.5rem 0; }
.faq-question { font-weight: 600; color: var(--color-brand-blue); margin-bottom: 0.5rem; display: block; }
.faq-answer { color: var(--color-text-secondary); margin: 0; }

/* 
   ----------------
   LEGAL PAGES
   ----------------
*/
.legal-container {
    padding: 4rem 0; max-width: 800px; margin: 0 auto;
}
.legal-content h1 { font-size: 2.5rem; margin-bottom: 0.5rem; color: var(--color-brand-blue); }
.last-updated { color: var(--color-text-secondary); font-size: 0.9rem; margin-bottom: 3rem; }
.legal-content section { margin-bottom: 3rem; }
.legal-content h2 { font-size: 1.5rem; margin-bottom: 1rem; color: var(--color-brand-blue); }
.legal-content p, .legal-content li { color: var(--color-text-secondary); line-height: 1.7; margin-bottom: 1rem; }
.legal-content ul { padding-left: 1.5rem; }

/* Footer */
.main-footer {
    border-top: 1px solid var(--color-border);
    padding: 2rem 0; margin-top: auto;
}
.footer-links {
    display: flex; justify-content: center; gap: 2rem; margin-bottom: 1rem;
}
.footer-link { color: var(--color-text-secondary); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.footer-link:hover { color: var(--color-brand-blue); }
.footer-copy { text-align: center; color: var(--color-text-secondary); font-size: 0.9rem; opacity: 0.8; }

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--color-text-secondary);
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover {
  color: var(--color-brand-blue);
}
.theme-toggle svg {
  width: 24px;
  height: 24px;
}
.theme-toggle .moon-icon { display: none; }
.theme-toggle .sun-icon { display: block; }

body.dark-mode .theme-toggle .moon-icon { display: block; }
body.dark-mode .theme-toggle .sun-icon { display: none; }

/* Responsive */
@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    .stepper-container { flex-direction: column; gap: 2rem; }
    .stepper-container::before { width: 2px; height: 100%; left: 24px; top: 0; }
    .step-item { width: 100%; text-align: left; padding-left: 5rem; text-align: left; }
    .step-badge { position: absolute; left: 0; margin: 0; }
}

/* Contact Page Styling */
.contact-section {
  padding: 4rem 1rem;
  max-width: 1000px; /* Increased to 1000px as requested */
  margin: 0 auto;
}

.contact-title {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--color-brand-blue); /* Uses variable for dark mode support */
}

.contact-card {
  background: var(--color-bg-card);
  padding: 2.5rem; /* Slightly larger padding */
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border); /* Subtle border for better definition in dark mode */
}

.contact-form-group {
  margin-bottom: 1.5rem;
}

.contact-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.contact-input, 
.contact-select, 
.contact-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  font-family: var(--font-primary);
  background-color: var(--color-input-bg);
  color: var(--color-text-primary);
  transition: border-color 0.2s;
}

.contact-input:focus, 
.contact-select:focus, 
.contact-textarea:focus {
  outline: none;
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.contact-actions {
  margin-top: 2rem;
}

/* Tools Section */
.tools-section {
  padding: 2rem 0 4rem;
}

.tools-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.tool-card {
  background: var(--color-brand-blue); /* Dark by default as per image design or adapt? Image showed dark cards. */
  /* Wait, if I use brand-blue (#0f172a), text needs to be white.
     Let's style it properly to adapt or stick to the specific "Tools" look.
     The request implies a specific UI component.
     Let's try to match the screenshot vibe while respecting theme. 
  */
  background-color: var(--color-bg-card); /* Adaptive */
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* In dark mode, it will naturally be dark. In light mode, it will be white. */
/* If the user wants EXACTLY the dark look always, I should force it. 
   But "Theme Toggle" implies adaptation. I'll stick to adaptive for now. */

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-accent-blue);
}

.tool-icon-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 2rem;
}

.word-bg {
  background-color: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.excel-bg {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.tool-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
}

.tool-desc {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

/* Business Strategy Section */
.business-section {
  padding: 4rem 0 6rem;
}

.business-cta-card {
  background: var(--color-bg-secondary); /* Adaptive: Light Gray in Light Mode, Dark in Dark Mode */
  border-radius: 24px;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--color-text-primary); /* Adaptive text */
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border); /* Adaptive border */
}

/* Subtle pattern overlay - adjust opacity for adaptive backgrounds */
.business-cta-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(circle at top right, rgba(0,0,0,0.03) 0%, transparent 40%),
                    radial-gradient(circle at bottom left, rgba(0,0,0,0.03) 0%, transparent 40%);
  z-index: 0;
}

body.dark-mode .business-cta-card::before {
    background-image: radial-gradient(circle at top right, rgba(255,255,255,0.05) 0%, transparent 40%),
                      radial-gradient(circle at bottom left, rgba(255,255,255,0.05) 0%, transparent 40%);
}

.business-title {
  color: var(--color-brand-blue) !important; /* Adaptive: Dark in Light, Light in Dark */
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.business-desc {
  color: var(--color-text-secondary); /* Adaptive */
  opacity: 1;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
  font-size: 1.125rem;
  position: relative;
  z-index: 1;
}

.business-desc a {
  color: var(--color-accent-blue);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.business-desc a:hover {
  text-decoration-thickness: 2px;
}
