/* ═══════════════════════════════════════════════════════════
   Passport Photo Maker — Main Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #a5b4fc;
  --secondary: #8b5cf6;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;

  --bg: #f8faff;
  --bg-card: #ffffff;
  --bg-glass: rgba(255,255,255,0.85);
  --bg-glass-border: rgba(255,255,255,0.6);
  --text: #1e1b4b;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --border: #e5e7eb;
  --border-focus: #6366f1;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(99,102,241,0.10), 0 1px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 20px 60px rgba(99,102,241,0.15), 0 4px 16px rgba(0,0,0,0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}

.dark-mode {
  --bg: #0f0e17;
  --bg-card: #1a1830;
  --bg-glass: rgba(26,24,48,0.92);
  --bg-glass-border: rgba(255,255,255,0.08);
  --text: #f0eeff;
  --text-2: #a5b4fc;
  --text-3: #6366f1;
  --border: #2d2b55;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

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

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 99px; }

/* ── Container ────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 12px 24px; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(99,102,241,0.45); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-card); color: var(--primary);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 20px; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
}
.btn-secondary:hover { border-color: var(--primary); background: rgba(99,102,241,0.06); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.15); color: #fff;
  border: 1.5px solid rgba(255,255,255,0.35); border-radius: var(--radius-sm);
  padding: 12px 24px; font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition); backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: rgba(255,255,255,0.25); }

.btn-icon {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg); color: var(--text-2);
  border: 1px solid var(--border); border-radius: var(--radius-xs);
  padding: 8px 12px; font-size: 0.8rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
}
.btn-icon:hover { border-color: var(--primary); color: var(--primary); }

.btn-download {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 14px 24px; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: all var(--transition);
  box-shadow: 0 4px 14px rgba(16,185,129,0.35);
  letter-spacing: 0.01em;
}
.btn-download:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(16,185,129,0.45); }

/* ── Theme Toggle ─────────────────────────────────────────── */
.theme-toggle {
  position: fixed; top: 20px; right: 20px; z-index: 1000;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-glass); border: 1px solid var(--bg-glass-border);
  backdrop-filter: blur(12px); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); box-shadow: var(--shadow-md);
  transition: all var(--transition);
}
.theme-toggle:hover { transform: scale(1.1); }
.theme-toggle svg { width: 18px; height: 18px; transition: all var(--transition); }
.light-mode .moon-icon { display: none; }
.dark-mode .sun-icon { display: none; }

/* ── Loading Overlay ──────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(15,14,23,0.75); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
}
.loading-overlay.active { display: flex; }
.loading-content {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 40px 48px; text-align: center;
  box-shadow: var(--shadow-lg); min-width: 280px;
}
.loading-spinner {
  width: 48px; height: 48px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite; margin: 0 auto 16px;
}
.loading-text { color: var(--text-2); font-size: 0.95rem; margin-bottom: 16px; }
.progress-bar-wrap {
  height: 4px; background: var(--border); border-radius: 99px; overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0%; border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.3s ease;
}

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

/* ── Navbar ───────────────────────────────────────────────── */
.hero { background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4c1d95 100%); position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(99,102,241,0.25) 0%, transparent 60%),
              radial-gradient(ellipse at 20% 80%, rgba(139,92,246,0.2) 0%, transparent 50%);
}

.navbar {
  display: flex; align-items: center; gap: 32px;
  padding: 20px 32px; position: relative; z-index: 10;
  max-width: 1200px; margin: 0 auto;
}
.nav-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 1.1rem; font-weight: 500; }
.nav-logo strong { font-weight: 800; }
.nav-links { display: flex; list-style: none; gap: 8px; margin-left: auto; }
.nav-links a { color: rgba(255,255,255,0.75); padding: 8px 14px; border-radius: var(--radius-xs); font-size: 0.875rem; font-weight: 500; transition: all var(--transition); }
.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.nav-cta { margin-left: 8px; background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.3); border-radius: var(--radius-xs); padding: 8px 18px; font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: all var(--transition); backdrop-filter: blur(8px); }
.nav-cta:hover { background: rgba(255,255,255,0.25); }
.mobile-menu-btn { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.mobile-menu-btn span { display: block; width: 22px; height: 2px; background: rgba(255,255,255,0.8); border-radius: 2px; transition: all var(--transition); }
.mobile-menu { display: none; flex-direction: column; gap: 4px; padding: 12px 32px 20px; position: relative; z-index: 9; }
.mobile-menu a { color: rgba(255,255,255,0.85); font-size: 0.95rem; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.mobile-menu.open { display: flex; }

/* ── Hero Content ─────────────────────────────────────────── */
.hero-content {
  max-width: 600px; padding: 60px 32px 80px;
  margin: 0 auto; text-align: center; position: relative; z-index: 2;
}
.hero-badge {
  display: inline-block; background: rgba(99,102,241,0.25);
  border: 1px solid rgba(99,102,241,0.4); color: var(--primary-light);
  border-radius: 99px; padding: 6px 16px; font-size: 0.8rem; font-weight: 600;
  margin-bottom: 20px; backdrop-filter: blur(8px);
}
.hero h1 { font-size: clamp(2rem,5vw,3.2rem); font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 16px; }
.hero-sub { color: rgba(255,255,255,0.75); font-size: 1.05rem; line-height: 1.65; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 40px; }
.hero-btn { padding: 14px 28px; font-size: 1rem; }
.hero-stats { display: flex; align-items: center; gap: 24px; justify-content: center; }
.stat { text-align: center; }
.stat strong { display: block; font-size: 1.5rem; font-weight: 800; color: #fff; }
.stat span { font-size: 0.75rem; color: rgba(255,255,255,0.6); }
.stat-divider { width: 1px; height: 36px; background: rgba(255,255,255,0.2); }

/* ── Hero Visual ──────────────────────────────────────────── */
.hero-visual { display: flex; justify-content: center; padding-bottom: 60px; position: relative; z-index: 2; }
.hero-card {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius); padding: 24px; backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3); position: relative; min-width: 160px;
}
.floating { animation: float 4s ease-in-out infinite; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }

.photo-preview-demo {
  width: 120px; height: 154px; background: #e5e7eb; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  overflow: hidden; position: relative; margin: 0 auto 12px;
}
.demo-head {
  width: 52px; height: 52px; border-radius: 50%; background: #d1d5db;
  position: absolute; top: 20px;
}
.demo-body {
  width: 80px; height: 60px; border-radius: 40px 40px 0 0; background: #9ca3af;
  position: absolute; bottom: -10px;
}
.demo-overlay { position: absolute; inset: 0; }
.demo-corner { position: absolute; width: 14px; height: 14px; border-color: var(--primary); border-style: solid; }
.demo-corner.tl { top: 4px; left: 4px; border-width: 2px 0 0 2px; }
.demo-corner.tr { top: 4px; right: 4px; border-width: 2px 2px 0 0; }
.demo-corner.bl { bottom: 4px; left: 4px; border-width: 0 0 2px 2px; }
.demo-corner.br { bottom: 4px; right: 4px; border-width: 0 2px 2px 0; }
.demo-badge {
  background: rgba(16,185,129,0.2); color: #6ee7b7;
  border: 1px solid rgba(16,185,129,0.3); border-radius: 99px;
  padding: 4px 12px; font-size: 0.72rem; font-weight: 600; text-align: center;
}

/* ── Section Shared ───────────────────────────────────────── */
.section-header { text-align: center; margin-bottom: 48px; }
.section-tag {
  display: inline-block; background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.12));
  color: var(--primary); border: 1px solid rgba(99,102,241,0.25);
  border-radius: 99px; padding: 4px 14px; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px;
}
.section-header h2 { font-size: clamp(1.6rem,3vw,2.4rem); font-weight: 800; margin-bottom: 12px; }
.section-header p { color: var(--text-2); font-size: 1.05rem; max-width: 560px; margin: 0 auto; }

/* ── Tool Section ─────────────────────────────────────────── */
.tool-section { padding: 80px 0; }

/* ── Steps Indicator ──────────────────────────────────────── */
.steps-indicator {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 40px; flex-wrap: nowrap; overflow-x: auto;
  padding-bottom: 4px;
}
.step {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 70px; cursor: default;
}
.step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--border); color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; transition: all var(--transition);
}
.step.active .step-num { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; box-shadow: 0 4px 12px rgba(99,102,241,0.4); }
.step.done .step-num { background: var(--success); color: #fff; }
.step-label { font-size: 0.7rem; color: var(--text-3); font-weight: 500; }
.step.active .step-label { color: var(--primary); }
.step-line { flex: 1; height: 2px; background: var(--border); min-width: 20px; max-width: 60px; }

/* ── Tool Panel ───────────────────────────────────────────── */
.tool-panel {
  background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow-md); border: 1px solid var(--border);
  overflow: hidden;
}

/* ── Upload Zone ──────────────────────────────────────────── */
.upload-zone {
  padding: 64px 32px;
  border: 2px dashed var(--border); border-radius: var(--radius);
  text-align: center; cursor: pointer;
  transition: all var(--transition);
  background: linear-gradient(135deg, rgba(99,102,241,0.02), rgba(139,92,246,0.02));
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(139,92,246,0.06));
}
.upload-zone h3 { font-size: 1.25rem; font-weight: 700; margin: 12px 0 8px; }
.upload-zone p { color: var(--text-2); font-size: 0.95rem; }
.browse-btn { background: none; border: none; color: var(--primary); font-weight: 600; cursor: pointer; font-size: inherit; text-decoration: underline; }
.upload-hints { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.upload-hints span { font-size: 0.78rem; color: var(--text-3); }
.upload-tips { display: flex; gap: 16px; padding: 16px 32px; border-top: 1px solid var(--border); flex-wrap: wrap; justify-content: center; }
.tip { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-2); }
.tip-icon { color: var(--success); font-weight: 700; }

/* ── Detection Banner ─────────────────────────────────────── */
.detection-banner {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  background: var(--bg); flex-wrap: wrap;
}
.detection-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(99,102,241,0.1); }
.detection-info strong { display: block; font-size: 0.9rem; }
.detection-info span { font-size: 0.8rem; color: var(--text-2); }
.detection-banner.success .detection-icon { background: rgba(16,185,129,0.12); }
.detection-banner.warning .detection-icon { background: rgba(245,158,11,0.12); }
.detection-banner.error .detection-icon { background: rgba(239,68,68,0.12); }
.detection-warnings { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.warn-tag {
  background: rgba(245,158,11,0.12); color: var(--warning);
  border: 1px solid rgba(245,158,11,0.25); border-radius: 99px;
  padding: 2px 10px; font-size: 0.72rem; font-weight: 600;
}
.spinner-sm {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

/* ── Editor Layout ────────────────────────────────────────── */
.editor-layout { display: grid; grid-template-columns: 260px 1fr 260px; gap: 0; }
.editor-controls { border-right: 1px solid var(--border); padding: 20px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; max-height: 80vh; }
.editor-canvas-wrap { padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.editor-preview { border-left: 1px solid var(--border); padding: 20px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; max-height: 80vh; }

/* ── Control Groups ───────────────────────────────────────── */
.control-group { padding: 14px 0; border-bottom: 1px solid var(--border); }
.control-group:last-child { border-bottom: none; }
.control-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-2); margin-bottom: 14px;
}

/* ── Country / Size ───────────────────────────────────────── */
.country-select-wrap { margin-bottom: 12px; }
.country-select-wrap label { display: block; font-size: 0.78rem; color: var(--text-2); margin-bottom: 4px; font-weight: 500; }
.styled-select {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-xs); background: var(--bg); color: var(--text);
  font-size: 0.85rem; cursor: pointer; transition: all var(--transition);
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236366f1' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.styled-select:focus { outline: none; border-color: var(--primary); }

.size-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.size-btn {
  padding: 5px 10px; border-radius: var(--radius-xs); font-size: 0.75rem; font-weight: 600;
  border: 1.5px solid var(--border); background: var(--bg); color: var(--text-2);
  cursor: pointer; transition: all var(--transition);
}
.size-btn:hover { border-color: var(--primary); color: var(--primary); }
.size-btn.active { border-color: var(--primary); background: rgba(99,102,241,0.1); color: var(--primary); }

.custom-size { padding-top: 10px; }
.size-input-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.size-input-group { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.size-input-group label { font-size: 0.7rem; color: var(--text-3); }
.size-input {
  width: 100%; padding: 7px 9px; border: 1.5px solid var(--border);
  border-radius: var(--radius-xs); background: var(--bg); color: var(--text);
  font-size: 0.82rem; transition: all var(--transition);
}
.size-input:focus { outline: none; border-color: var(--primary); }
.size-x { color: var(--text-3); font-size: 0.85rem; margin-top: 14px; }
.size-unit { padding: 7px 6px; border: 1.5px solid var(--border); border-radius: var(--radius-xs); background: var(--bg); color: var(--text); font-size: 0.78rem; cursor: pointer; margin-top: 14px; }
.size-info { margin-top: 8px; }
.size-info span { font-size: 0.75rem; color: var(--text-3); }

/* ── Background Colors ────────────────────────────────────── */
.remove-bg-btn { width: 100%; margin-bottom: 14px; justify-content: center; }
.bg-colors label { display: block; font-size: 0.78rem; color: var(--text-2); margin-bottom: 8px; font-weight: 500; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 40px; height: 40px; border-radius: var(--radius-xs); cursor: pointer;
  border: 2px solid transparent; transition: all var(--transition);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: 2px; position: relative;
}
.swatch:hover { transform: scale(1.1); }
.swatch.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.3); }
.swatch-label { font-size: 0.52rem; background: rgba(0,0,0,0.45); color: #fff; border-radius: 2px; padding: 1px 2px; white-space: nowrap; display: none; }
.swatch:hover .swatch-label { display: block; }
.custom-color-swatch { background: conic-gradient(#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00); overflow: hidden; }
.custom-color-swatch input[type="color"] { width: 100%; height: 100%; border: none; cursor: pointer; opacity: 0; position: absolute; inset: 0; }
.bg-status { font-size: 0.78rem; color: var(--success); margin-top: 8px; font-weight: 500; }

/* ── Sliders ──────────────────────────────────────────────── */
.slider-group { margin-bottom: 12px; }
.slider-group label { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.slider-group label span { color: var(--primary); font-weight: 700; }
.styled-range {
  width: 100%; -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 99px;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary) 50%, var(--border) 50%, var(--border) 100%);
  outline: none; cursor: pointer;
}
.styled-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); cursor: pointer;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25);
}

.crop-btns { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── DPI / Format ─────────────────────────────────────────── */
.dpi-group, .format-group { margin-bottom: 12px; }
.dpi-group label, .format-group label { font-size: 0.78rem; color: var(--text-2); display: block; margin-bottom: 6px; font-weight: 500; }
.radio-group { display: flex; flex-direction: column; gap: 4px; }
.radio-label { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; cursor: pointer; padding: 4px 6px; border-radius: 4px; transition: background var(--transition); }
.radio-label:hover { background: rgba(99,102,241,0.06); }
.radio-label input { accent-color: var(--primary); }
.radio-label small { color: var(--text-3); }

/* ── Cropper Area ─────────────────────────────────────────── */
.canvas-label { font-size: 0.72rem; color: var(--text-3); text-align: center; }
.cropper-container-wrap { flex: 1; max-height: 500px; overflow: hidden; border-radius: var(--radius-sm); background: repeating-conic-gradient(#e5e7eb 0% 25%, var(--bg) 0% 50%) 0 0/20px 20px; }
.dark-mode .cropper-container-wrap { background: repeating-conic-gradient(#1e1c3a 0% 25%, #0f0e17 0% 50%) 0 0/20px 20px; }
.canvas-actions { display: flex; gap: 10px; justify-content: center; }

/* Cropper.js overrides */
.cropper-view-box, .cropper-face { border-radius: 0; }
.cropper-bg { background-image: repeating-conic-gradient(#e5e7eb 0% 25%, transparent 0% 50%) 0 0/16px 16px; }

/* ── Preview ──────────────────────────────────────────────── */
.preview-frame {
  width: 100%; min-height: 200px; border-radius: var(--radius-sm);
  background: repeating-conic-gradient(#e5e7eb 0% 25%, #f3f4f6 0% 50%) 0 0/16px 16px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); overflow: hidden; position: relative;
}
.dark-mode .preview-frame { background: repeating-conic-gradient(#1e1c3a 0% 25%, #0f0e17 0% 50%) 0 0/16px 16px; }
.preview-placeholder { text-align: center; color: var(--text-3); padding: 24px; }
.preview-placeholder p { font-size: 0.82rem; margin-top: 8px; }

/* ── Export / File Info ───────────────────────────────────── */
.file-info { font-size: 0.75rem; color: var(--text-3); text-align: center; margin-top: 8px; }

/* ── Print Section ────────────────────────────────────────── */
.print-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.print-opt-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.print-opt-row label { font-size: 0.78rem; color: var(--text-2); min-width: 44px; font-weight: 500; }
.copies-btns, .paper-btns { display: flex; gap: 4px; }
.copies-btn, .paper-btn {
  padding: 4px 10px; border-radius: 4px; border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text-2); font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.copies-btn.active, .paper-btn.active { border-color: var(--primary); background: rgba(99,102,241,0.1); color: var(--primary); }
.print-preview { width: 100%; }
.print-preview canvas { max-width: 100%; border-radius: 4px; box-shadow: var(--shadow-sm); }

/* ── Features Section ─────────────────────────────────────── */
.features-section { padding: 80px 0; background: var(--bg); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(99,102,241,0.3); }
.feature-icon {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.12));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; color: var(--primary);
}
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 0.875rem; color: var(--text-2); line-height: 1.6; }

/* ── How It Works ─────────────────────────────────────────── */
.steps-section { padding: 80px 0; background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.04)); }
.how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 24px; }
.how-step {
  display: flex; gap: 20px; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: all var(--transition);
}
.how-step:hover { border-color: rgba(99,102,241,0.3); box-shadow: var(--shadow-md); }
.how-num {
  font-size: 2rem; font-weight: 900; line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; flex-shrink: 0;
}
.how-content h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.how-content p { font-size: 0.85rem; color: var(--text-2); line-height: 1.6; }

/* ── Sizes Table ──────────────────────────────────────────── */
.sizes-section { padding: 80px 0; }
.sizes-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.sizes-table { width: 100%; border-collapse: collapse; }
.sizes-table th { background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.08)); color: var(--text); font-size: 0.82rem; font-weight: 700; padding: 14px 20px; text-align: left; border-bottom: 1px solid var(--border); }
.sizes-table td { padding: 13px 20px; font-size: 0.875rem; border-bottom: 1px solid var(--border); color: var(--text-2); }
.sizes-table tr:last-child td { border-bottom: none; }
.sizes-table tr:hover td { background: rgba(99,102,241,0.03); }
.sizes-table td:last-child { color: var(--success); font-weight: 700; }

/* ── Requirements ─────────────────────────────────────────── */
.requirements-section { padding: 80px 0; background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.04)); }
.req-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.req-card { background: var(--bg-card); border-radius: var(--radius); padding: 28px; border: 1px solid var(--border); }
.req-do { border-top: 3px solid var(--success); }
.req-dont { border-top: 3px solid var(--error); }
.req-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 16px; }
.req-do h3 { color: var(--success); }
.req-dont h3 { color: var(--error); }
.req-card ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.req-card ul li { font-size: 0.875rem; color: var(--text-2); padding-left: 18px; position: relative; }
.req-do ul li::before { content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: 700; }
.req-dont ul li::before { content: '✗'; position: absolute; left: 0; color: var(--error); font-weight: 700; }

/* ── FAQ ──────────────────────────────────────────────────── */
.faq-section { padding: 80px 0; }
.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.faq-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; transition: all var(--transition); }
.faq-item:hover { border-color: rgba(99,102,241,0.3); }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px; background: none; border: none; text-align: left;
  font-size: 0.92rem; font-weight: 600; color: var(--text); cursor: pointer;
  transition: color var(--transition); gap: 12px;
}
.faq-q:hover { color: var(--primary); }
.faq-arrow { color: var(--text-3); font-size: 1.1rem; transition: transform var(--transition); flex-shrink: 0; }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-a { display: none; padding: 0 20px 18px; border-top: 1px solid var(--border); }
.faq-a p { font-size: 0.875rem; color: var(--text-2); line-height: 1.7; padding-top: 14px; }
.faq-item.open .faq-a { display: block; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer { background: var(--bg-card); border-top: 1px solid var(--border); padding: 60px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand p { font-size: 0.875rem; color: var(--text-2); margin-top: 12px; line-height: 1.6; }
.footer-col h4 { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 16px; color: var(--text); }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a { font-size: 0.875rem; color: var(--text-2); transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; }
.footer-bottom p { font-size: 0.8rem; color: var(--text-3); margin-bottom: 4px; }
.footer-disclaimer { font-style: italic; }

/* ── Toast Notifications ──────────────────────────────────── */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 20px;
  font-size: 0.875rem; font-weight: 500; color: var(--text);
  box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease;
  max-width: 320px; display: flex; align-items: center; gap: 10px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
.toast.warning { border-left: 3px solid var(--warning); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }
.toast.removing { animation: slideOut 0.3s ease forwards; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .editor-layout { grid-template-columns: 1fr; }
  .editor-controls, .editor-preview { border: none; border-top: 1px solid var(--border); max-height: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .navbar { padding: 16px 20px; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .mobile-menu-btn { display: flex; }
  .hero-content { padding: 40px 20px 60px; }
  .hero-stats { gap: 16px; }
  .tool-section { padding: 40px 0; }
  .req-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .section-header { margin-bottom: 32px; }
  .how-steps { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
  .steps-section, .features-section, .sizes-section, .requirements-section, .faq-section { padding: 56px 0; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-btn { width: 100%; justify-content: center; }
  .sizes-table td, .sizes-table th { padding: 10px 12px; font-size: 0.8rem; }
}
