/* ==========================================================================
   SMARTDOCIFY - PASSPORT FRONT & BACK PRINT SHEET STYLESHEET
   Matches SmartDocify Design System: Dark theme, modern elevation, responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS VARIABLES & THEME TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette */
  --bg-page: #080d1a;
  --bg-surface: #111c30;
  --bg-surface-elevated: #16233b;
  --bg-surface-hover: #1c2c48;
  --bg-card: rgba(17, 28, 48, 0.7);

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-glow: rgba(37, 99, 235, 0.25);

  --secondary: #7c3aed;
  --secondary-hover: #6d28d9;
  --secondary-light: #8b5cf6;

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.25);

  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.25);

  --warning: #f59e0b;

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-inverse: #ffffff;

  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(37, 99, 235, 0.45);
  --border-focus: #3b82f6;

  /* Elevation & Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(37, 99, 235, 0.2);

  /* Geometry & Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --container-max: 1240px;
}

/* Light theme overrides */
[data-theme="light"] {
  --bg-page: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-surface-hover: #e2e8f0;
  --bg-card: #ffffff;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --text-inverse: #ffffff;

  --border-subtle: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(37, 99, 235, 0.6);
  --border-focus: #2563eb;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);
}

/* --------------------------------------------------------------------------
   2. RESET & GLOBAL BASE STYLES
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Subtle background accent glow */
body::before {
  content: '';
  position: fixed;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 480px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, rgba(124, 58, 237, 0.06) 50%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

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

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

button, input, select {
  font-family: inherit;
  font-size: inherit;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   3. SITE HEADER & NAVIGATION
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 13, 26, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.88);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* Logo */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.logo-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.logo-svg {
  width: 30px;
  height: 30px;
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

/* Desktop Navigation */
.desktop-nav {
  display: none;
}

@media (min-width: 900px) {
  .desktop-nav {
    display: block;
  }
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-link {
  display: inline-block;
  padding: 7px 14px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: #3b82f6;
  background: rgba(37, 99, 235, 0.1);
  font-weight: 600;
}

/* Header Action Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
}

.ui-icon {
  width: 20px;
  height: 20px;
}

/* Dark/Light mode icon toggles */
[data-theme="dark"] .icon-sun {
  display: block;
}
[data-theme="dark"] .icon-moon {
  display: none;
}
[data-theme="light"] .icon-sun {
  display: none;
}
[data-theme="light"] .icon-moon {
  display: block;
}

/* Mobile Hamburger Menu */
.menu-toggle {
  display: inline-flex;
}

@media (min-width: 900px) {
  .menu-toggle {
    display: none;
  }
}

.hamburger-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 18px;
}

.hamburger-line {
  height: 2px;
  width: 100%;
  background-color: currentColor;
  border-radius: 2px;
}

/* Mobile Nav Drawer & Backdrop */
.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-nav-backdrop.open {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 80vw;
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  z-index: 210;
  flex-direction: column;
  padding: 24px;
  transform: translateX(100%);
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav-drawer.open {
  display: flex;
  transform: translateX(0);
  pointer-events: auto;
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-nav-link {
  display: block;
  padding: 10px 14px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: #3b82f6;
  background: rgba(37, 99, 235, 0.1);
}

/* --------------------------------------------------------------------------
   4. BUTTONS & UI COMPONENTS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Button Variants */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary) 0%, #6d28d9 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}

.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
  transform: translateY(-1px);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
  color: #ffffff;
}

.btn-danger-outline {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: #f87171;
}

.btn-danger-outline:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: #ef4444;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

/* Button Sizes */
.btn-xs {
  padding: 5px 10px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  gap: 5px;
}
.btn-xs svg {
  width: 14px;
  height: 14px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.86rem;
  border-radius: var(--radius-md);
  gap: 6px;
}

.btn-lg {
  padding: 13px 24px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
  gap: 10px;
}
.btn-lg svg {
  width: 20px;
  height: 20px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* --------------------------------------------------------------------------
   5. HERO & PRIVACY TRUST SECTION
   -------------------------------------------------------------------------- */
.tool-hero-section {
  padding: 44px 0 24px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: #60a5fa;
  margin-bottom: 14px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.hero-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 40%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .hero-title {
  background: linear-gradient(135deg, #0f172a 40%, #1d4ed8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 20px;
}

.privacy-trust-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: #34d399;
}

.trust-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Global Alert Error */
.alert-error {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-md);
  color: #fca5a5;
  font-size: 0.92rem;
  margin-bottom: 20px;
}

.alert-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.alert-close-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #fca5a5;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 4px;
}

/* --------------------------------------------------------------------------
   6. MAIN TWO-COLUMN WORKSPACE
   -------------------------------------------------------------------------- */
.workspace-section {
  padding-bottom: 60px;
}

.workspace-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

@media (min-width: 1024px) {
  .workspace-container {
    grid-template-columns: 520px minmax(0, 1fr);
    gap: 32px;
  }
}

@media (min-width: 1200px) {
  .workspace-container {
    grid-template-columns: 560px minmax(0, 1fr);
    gap: 36px;
  }
}

.controls-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  max-width: 100%;
}

.preview-column {
  position: sticky;
  top: 88px;
  min-width: 0;
  max-width: 100%;
}

/* Card Style */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
  max-width: 100%;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 800;
}

.card-status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.card-status-badge.uploaded {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: #34d399;
}

/* --------------------------------------------------------------------------
   7. UPLOAD DROPZONES & ACTIVE CARD BODY
   -------------------------------------------------------------------------- */
.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 18px;
  background: rgba(17, 28, 48, 0.4);
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-dropzone:hover,
.upload-dropzone:focus-visible {
  border-color: #3b82f6;
  background: rgba(37, 99, 235, 0.05);
  outline: none;
}

.upload-dropzone.dragover {
  border-color: #60a5fa !important;
  background: rgba(37, 99, 235, 0.12) !important;
  transform: scale(1.01);
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.1);
  border-radius: var(--radius-md);
  color: #60a5fa;
  margin-bottom: 12px;
}

.dropzone-icon svg {
  width: 28px;
  height: 28px;
}

.dropzone-text {
  font-size: 0.96rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.dropzone-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.upload-action-btn {
  margin-bottom: 12px;
}

.dropzone-supported {
  font-size: 0.76rem;
  color: var(--text-dim);
}

/* Active Uploaded State Card Body */
.uploaded-media-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.uploaded-thumb-box {
  width: 72px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: #000000;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.uploaded-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.uploaded-meta-box {
  min-width: 0;
  flex: 1;
}

.uploaded-file-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.uploaded-meta-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
}

.meta-tag {
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.meta-tag-dim {
  color: #60a5fa;
}

.meta-tag-rot {
  color: #a78bfa;
}

/* Controls Toolbar (Rotate, Zoom, Actions) */
.uploaded-controls-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
}

.toolbar-btn-group,
.toolbar-action-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-zoom-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.toolbar-zoom-wrap .range-slider {
  width: 80px;
}

/* --------------------------------------------------------------------------
   8. SETTINGS CONTROLS & FORM INPUTS
   -------------------------------------------------------------------------- */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

@media (max-width: 640px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-select,
.form-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-select:focus,
.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.range-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
  margin-top: 4px;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Custom Checkboxes */
.options-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 0.88rem;
  color: var(--text-main);
}

.custom-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-box {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.custom-checkbox input[type="checkbox"]:checked + .checkbox-box {
  background: #2563eb;
  border-color: #2563eb;
}

.custom-checkbox input[type="checkbox"]:checked + .checkbox-box::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.custom-checkbox code {
  font-family: monospace;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  color: #60a5fa;
}

/* Output Filename Wrap */
.filename-config-wrap {
  margin-bottom: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.input-with-ext {
  display: flex;
  align-items: center;
  position: relative;
  margin-bottom: 8px;
}

.input-with-ext .form-input {
  padding-right: 60px;
}

.input-ext-badge {
  position: absolute;
  right: 12px;
  font-size: 0.82rem;
  color: var(--text-dim);
  font-family: monospace;
  pointer-events: none;
}

.branding-checkbox-label {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.resolved-filename-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 6px;
}

.resolved-filename-hint strong {
  color: #60a5fa;
}

/* Action Buttons Grid */
.action-buttons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 520px) {
  .action-buttons-grid {
    grid-template-columns: 1fr;
  }
}

.action-btn-main {
  width: 100%;
}

/* Progress Box */
.progress-box {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.progress-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  transition: width 0.2s ease;
}

/* Success Card */
.success-card {
  margin-top: 20px;
  padding: 16px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-md);
}

.success-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.success-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--success);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.success-icon-badge svg {
  width: 20px;
  height: 20px;
}

.success-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #34d399;
}

.success-meta-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.success-details-box {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .success-details-box {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.success-detail-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.detail-name {
  color: var(--text-dim);
}

.detail-val {
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.success-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   9. LIVE PREVIEW STAGE (RIGHT COLUMN)
   -------------------------------------------------------------------------- */
.preview-card {
  display: flex;
  flex-direction: column;
}

.preview-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.preview-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.preview-sheet-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.preview-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #34d399;
}

.live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* Sheet Viewport */
.sheet-viewport-wrapper {
  background: #040812;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  overflow: hidden;
  position: relative;
}

[data-theme="light"] .sheet-viewport-wrapper {
  background: #cbd5e1;
}

[data-theme="light"] .upload-dropzone {
  background: var(--bg-surface-elevated);
  border-color: #cbd5e1;
}

[data-theme="light"] .upload-dropzone:hover,
[data-theme="light"] .upload-dropzone:focus-visible {
  background: rgba(37, 99, 235, 0.05);
  border-color: var(--primary);
}

[data-theme="light"] .uploaded-thumb-box {
  background: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
}

[data-theme="light"] .btn-outline:hover:not(:disabled) {
  background: var(--bg-surface-hover);
  color: var(--text-main);
  border-color: var(--border-hover);
}

[data-theme="light"] .card:hover {
  border-color: var(--border-hover);
}

[data-theme="light"] .faq-item:hover {
  border-color: var(--border-hover);
}

.sheet-container {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.7);
  border-radius: 2px;
  background: #ffffff;
}

.live-sheet-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 2px;
}

.preview-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-dim);
}

.preview-helper-hint {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hint-icon {
  width: 14px;
  height: 14px;
  color: #34d399;
}

/* --------------------------------------------------------------------------
   10. SEO CONTENT & FAQ ACCORDION
   -------------------------------------------------------------------------- */
.seo-content-section {
  padding: 40px 0 60px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.15);
}

.seo-container {
  max-width: 900px;
}

.seo-intro-card {
  margin-bottom: 40px;
}

.seo-intro-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 14px;
}

.seo-intro-card p {
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

/* Workflow Steps */
.workflow-guide-box {
  margin-bottom: 44px;
}

.guide-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 20px;
}

.guide-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  position: relative;
}

.step-badge {
  width: 26px;
  height: 26px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.step-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.step-card p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* FAQ Accordion */
.faq-section-box {
  margin-bottom: 36px;
}

.faq-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 18px;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.96rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  gap: 12px;
}

.faq-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(180deg);
  color: #3b82f6;
}

.faq-answer {
  padding: 0 20px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Disclaimer Card */
.disclaimer-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.disclaimer-icon {
  width: 18px;
  height: 18px;
  color: #f59e0b;
  flex-shrink: 0;
  margin-top: 2px;
}

.disclaimer-card strong {
  color: #fbbf24;
}

/* --------------------------------------------------------------------------
   11. SITE FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  background: #050811;
  border-top: 1px solid var(--border-subtle);
  padding: 50px 0 24px;
}

[data-theme="light"] .site-footer {
  background: #e2e8f0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 36px;
}

.footer-col-brand {
  grid-column: span 1;
}

@media (min-width: 768px) {
  .footer-col-brand {
    grid-column: span 2;
  }
}

.footer-logo {
  margin-bottom: 12px;
}

.footer-tagline {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
  max-width: 320px;
}

.footer-privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #34d399;
}

.footer-privacy-badge svg {
  width: 14px;
  height: 14px;
}

.footer-heading {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.footer-links a {
  font-size: 0.86rem;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: #3b82f6;
}

.footer-meta-note {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   12. PRINT-SPECIFIC CSS (@media print)
   Critical: Prints ONLY the generated A4 sheet!
   -------------------------------------------------------------------------- */
.print-only-container {
  display: none;
}

@media print {
  @page {
    size: auto;
    margin: 0mm;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh !important;
    overflow: visible !important;
  }

  body::before,
  .site-header,
  .mobile-nav-backdrop,
  .mobile-nav-drawer,
  .tool-hero-section,
  .controls-column,
  .preview-card-header,
  .preview-footer-bar,
  .seo-content-section,
  .site-footer,
  .alert-error {
    display: none !important;
  }

  .workspace-section {
    padding: 0 !important;
    margin: 0 !important;
  }

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

  .preview-column,
  .preview-card,
  .sheet-viewport-wrapper {
    position: static !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: block !important;
    min-height: auto !important;
    width: 100% !important;
  }

  .sheet-container {
    box-shadow: none !important;
    background: #ffffff !important;
    margin: 0 auto !important;
    width: 100% !important;
  }

  .live-sheet-canvas {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    page-break-after: avoid !important;
  }
}
