/* ==========================================================================
   ClonyPDF Passport Photo Maker — v2 Production Stylesheet
   Mobile-first • Government trust • Modern SaaS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400&display=swap');

/* --------------------------------------------------------------------------
   DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  --blue-900: #0c1f4a;
  --blue-800: #1a3a6b;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;

  --green-700: #15803d;
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --green-50:  #f0fdf4;

  --amber-700: #b45309;
  --amber-100: #fef3c7;

  --red-700:   #b91c1c;
  --red-100:   #fee2e2;
  --red-50:    #fef2f2;

  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;

  --white: #ffffff;

  /* Semantic aliases */
  --color-primary:        var(--blue-700);
  --color-primary-hover:  var(--blue-800);
  --color-primary-light:  var(--blue-50);
  --color-success:        var(--green-600);
  --color-success-light:  var(--green-50);
  --color-warning:        var(--amber-700);
  --color-warning-light:  var(--amber-100);
  --color-error:          var(--red-700);
  --color-error-light:    var(--red-50);
  --color-surface:        var(--white);
  --color-bg:             var(--slate-50);
  --color-border:         var(--slate-200);
  --color-text:           var(--slate-900);
  --color-text-2:         var(--slate-700);
  --color-text-muted:     var(--slate-400);

  /* Typography */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;

  /* Spacing */
  --s1:  0.25rem;  --s2:  0.5rem;  --s3:  0.75rem; --s4:  1rem;
  --s5:  1.25rem; --s6:  1.5rem;  --s8:  2rem;    --s10: 2.5rem;
  --s12: 3rem;    --s16: 4rem;    --s20: 5rem;

  /* Radii */
  --r-sm: 6px;  --r-md: 10px; --r-lg: 16px;
  --r-xl: 24px; --r-full: 9999px;

  /* Shadows */
  --shadow-sm:   0 1px 2px rgba(0,0,0,.05);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg:   0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --shadow-xl:   0 20px 25px -5px rgba(0,0,0,.1),  0 8px 10px -6px rgba(0,0,0,.06);
  --shadow-card: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-card-hover: 0 8px 24px rgba(0,0,0,.09);
  --shadow-btn:  0 1px 2px rgba(29,78,216,.25);
  --shadow-btn-hover: 0 4px 14px rgba(29,78,216,.35);

  /* Motion */
  --ease:  cubic-bezier(.4, 0, .2, 1);
  --fast:  150ms;
  --base:  220ms;
  --slow:  350ms;

  /* Layout */
  --max-w: 1080px;
  --tool-w: 660px;
  --header-h: 60px;
}

/* --------------------------------------------------------------------------
   RESET + BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, svg, canvas { display: block; max-width: 100%; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: var(--r-sm); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* --------------------------------------------------------------------------
   LAYOUT HELPERS
   -------------------------------------------------------------------------- */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 var(--s5); }
.tool-container { width: 100%; max-width: var(--tool-w); margin: 0 auto; padding: 0 var(--s5); }

/* --------------------------------------------------------------------------
   HEADER
   -------------------------------------------------------------------------- */
.site-header {
  height: var(--header-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo {
  display: flex; align-items: center; gap: var(--s2);
  font-size: var(--text-lg); font-weight: 800; color: var(--color-text);
  letter-spacing: -.02em; text-decoration: none;
}
.logo-mark {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: var(--text-sm);
}
.header-right { display: flex; align-items: center; gap: var(--s3); }
.header-badge {
  display: flex; align-items: center; gap: 5px;
  font-size: var(--text-xs); font-weight: 600; color: var(--green-700);
  background: var(--green-100); padding: 4px 10px;
  border-radius: var(--r-full); border: 1px solid #bbf7d0;
}

/* --------------------------------------------------------------------------
   HERO
   -------------------------------------------------------------------------- */
.hero {
  background: linear-gradient(135deg, #0c1f4a 0%, #1a3564 45%, #1d4ed8 100%);
  position: relative; overflow: hidden;
  padding: var(--s12) 0 calc(var(--s16) + 60px);
  color: #fff; text-align: center;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 70% 10%, rgba(96,165,250,.12) 0%, transparent 55%),
              radial-gradient(ellipse 60% 80% at 20% 80%, rgba(59,130,246,.08) 0%, transparent 50%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #93c5fd; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  padding: 6px 14px; border-radius: var(--r-full); margin-bottom: var(--s4);
}
.hero-title {
  font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
  font-weight: 900; letter-spacing: -.03em; line-height: 1.1;
  margin-bottom: var(--s4);
}
.hero-subtitle {
  font-size: var(--text-lg); font-weight: 400;
  color: rgba(255,255,255,.72); max-width: 540px;
  margin: 0 auto var(--s8); line-height: 1.5;
}
.hero-trust {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: var(--s5); margin-bottom: var(--s8);
}
.trust-item {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--text-sm); font-weight: 500; color: rgba(255,255,255,.6);
}
.trust-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; flex-shrink: 0; }

/* --------------------------------------------------------------------------
   STEP WIZARD
   -------------------------------------------------------------------------- */
.step-wizard {
  display: flex; align-items: center;
  justify-content: center; gap: 0;
  max-width: 560px; margin: 0 auto;
}
.step-item {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--s2); flex: 1; position: relative;
}
.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px; left: calc(50% + 18px);
  width: calc(100% - 36px); height: 2px;
  background: rgba(255,255,255,.15);
  transition: background var(--base) var(--ease);
}
.step-item.completed:not(:last-child)::after { background: rgba(74,222,128,.4); }
.step-dot {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: 700;
  background: rgba(255,255,255,.08);
  border: 2px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.5);
  position: relative; z-index: 1;
  transition: all var(--base) var(--ease);
}
.step-item.active .step-dot {
  background: var(--blue-600); border-color: #93c5fd;
  color: #fff; box-shadow: 0 0 0 4px rgba(59,130,246,.25);
}
.step-item.completed .step-dot {
  background: var(--green-600); border-color: #4ade80;
  color: #fff; font-size: .875rem;
}
.step-label {
  font-size: 10px; font-weight: 600; letter-spacing: .03em;
  color: rgba(255,255,255,.45); white-space: nowrap;
  transition: color var(--base) var(--ease);
}
.step-item.active .step-label { color: #93c5fd; }
.step-item.completed .step-label { color: rgba(255,255,255,.65); }

/* --------------------------------------------------------------------------
   TOOL CARD (floats up from hero)
   -------------------------------------------------------------------------- */
.tool-lift {
  margin-top: -56px;
  padding-bottom: var(--s12);
  position: relative; z-index: 10;
}
.tool-card {
  background: var(--color-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl), 0 0 0 1px var(--color-border);
  overflow: hidden;
}
.tool-header {
  padding: var(--s5) var(--s6);
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--slate-50);
}
.tool-header-label {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--color-text-muted);
}
.tool-header-doc {
  display: flex; align-items: center; gap: var(--s2);
  font-size: var(--text-sm); font-weight: 600; color: var(--color-primary);
}
.tool-body { padding: var(--s6); }

/* --------------------------------------------------------------------------
   DOCUMENT SELECTOR (Phase 5)
   -------------------------------------------------------------------------- */
.doc-selector { display: flex; flex-direction: column; gap: var(--s5); }
.selector-row { display: flex; flex-direction: column; gap: var(--s2); }
.selector-label {
  font-size: var(--text-sm); font-weight: 600; color: var(--color-text-2);
  letter-spacing: -.01em;
}
.form-select {
  width: 100%; padding: 11px var(--s4);
  padding-right: var(--s10);
  font-family: var(--font); font-size: var(--text-base); font-weight: 500;
  color: var(--color-text); background: var(--color-bg);
  border: 1.5px solid var(--color-border); border-radius: var(--r-md);
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.form-select:hover { border-color: var(--slate-300); }
.form-select:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(29,78,216,.12); }

/* Document type chips */
.doc-type-grid {
  display: flex; flex-wrap: wrap; gap: var(--s2);
}
.doc-chip {
  padding: 8px 14px;
  font-family: var(--font); font-size: var(--text-sm); font-weight: 600;
  color: var(--slate-600); background: var(--color-bg);
  border: 1.5px solid var(--color-border); border-radius: var(--r-full);
  cursor: pointer; transition: all var(--fast) var(--ease);
  white-space: nowrap;
}
.doc-chip:hover { border-color: var(--blue-500); color: var(--blue-700); background: var(--blue-50); }
.doc-chip.active {
  background: var(--blue-700); border-color: var(--blue-700);
  color: #fff; box-shadow: var(--shadow-btn);
}

/* Specs strip */
.specs-strip {
  display: flex; align-items: center; gap: var(--s3);
  flex-wrap: wrap; padding: var(--s3) var(--s4);
  background: var(--blue-50); border: 1px solid var(--blue-100);
  border-radius: var(--r-md);
}
.specs-pill {
  display: flex; align-items: center; gap: 5px;
  font-size: var(--text-xs); font-weight: 600; color: var(--blue-800);
}
.specs-pill-icon { color: var(--blue-600); font-style: normal; }

/* Continue button */
.btn-continue {
  width: 100%; padding: 14px var(--s6);
  font-family: var(--font); font-size: var(--text-base); font-weight: 700;
  color: #fff; background: var(--blue-700);
  border: none; border-radius: var(--r-md);
  box-shadow: var(--shadow-btn);
  transition: all var(--fast) var(--ease);
  display: flex; align-items: center; justify-content: center; gap: var(--s2);
}
.btn-continue:hover { background: var(--blue-800); box-shadow: var(--shadow-btn-hover); transform: translateY(-1px); }
.btn-continue:active { transform: translateY(0); box-shadow: var(--shadow-btn); }

/* --------------------------------------------------------------------------
   UPLOAD ZONE (Phase 2 – Step 2)
   -------------------------------------------------------------------------- */
.upload-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--s12) var(--s8);
  border: 2px dashed var(--color-border);
  border-radius: var(--r-lg); cursor: pointer;
  text-align: center; position: relative;
  background: var(--slate-50); min-height: 260px;
  transition: all var(--base) var(--ease);
}
.upload-zone:hover, .upload-zone.drag-active {
  border-color: var(--blue-500); background: var(--blue-50);
}
.upload-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-icon-ring {
  width: 72px; height: 72px; border-radius: var(--r-lg);
  background: var(--blue-50); border: 2px solid var(--blue-100);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--s5); font-size: 2rem;
  transition: transform var(--base) var(--ease), background var(--base) var(--ease);
}
.upload-zone:hover .upload-icon-ring { transform: translateY(-3px); background: var(--blue-100); }
.upload-zone.drag-active .upload-icon-ring { transform: scale(1.1); }
.upload-title { font-size: var(--text-xl); font-weight: 700; color: var(--color-text); margin-bottom: var(--s2); letter-spacing: -.02em; }
.upload-sub   { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--s4); }
.upload-formats { display: flex; align-items: center; justify-content: center; gap: var(--s2); }
.format-tag {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--slate-600); background: var(--white);
  border: 1px solid var(--color-border); padding: 3px 8px; border-radius: var(--r-sm);
}

/* --------------------------------------------------------------------------
   EDITOR WORKSPACE (Phase 3 – Step 3)
   -------------------------------------------------------------------------- */
.editor-workspace { display: flex; flex-direction: column; gap: var(--s4); }
.canvas-shell {
  position: relative; width: 100%;
  background: var(--slate-100);
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  /* Aspect ratio is set dynamically */
  min-height: 280px;
}
#photoCanvas { width: 100%; height: 100%; cursor: grab; touch-action: none; will-change: transform; }
#photoCanvas:active { cursor: grabbing; }
.guide-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .45; }
.canvas-badge {
  position: absolute; bottom: var(--s3); right: var(--s3);
  background: rgba(0,0,0,.6); color: #fff;
  font-size: 10px; font-weight: 600; letter-spacing: .04em;
  padding: 3px 8px; border-radius: var(--r-sm);
  backdrop-filter: blur(4px);
}
.zoom-row {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--color-bg); border-radius: var(--r-md);
  border: 1px solid var(--color-border);
}
.zoom-icon { font-size: var(--text-sm); color: var(--color-text-muted); flex-shrink: 0; }
.slider {
  flex: 1; height: 6px; -webkit-appearance: none; appearance: none;
  background: var(--color-border); border-radius: 3px; outline: none; cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px;
  border-radius: var(--r-full); background: var(--blue-700);
  border: 3px solid var(--white); box-shadow: var(--shadow-md); cursor: pointer;
  transition: transform var(--fast) var(--ease);
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: var(--r-full);
  background: var(--blue-700); border: 3px solid var(--white); cursor: pointer;
}
.drag-hint {
  font-size: var(--text-xs); color: var(--color-text-muted);
  text-align: center; line-height: 1.4;
}

/* --------------------------------------------------------------------------
   COMPLIANCE PANEL (Phase 6)
   -------------------------------------------------------------------------- */
.compliance-panel { border-radius: var(--r-lg); overflow: hidden; }
.compliance-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s4) var(--s5);
  background: var(--white);
  border: 1px solid var(--color-border);
  border-bottom: none;
  border-radius: var(--r-md) var(--r-md) 0 0;
}
.compliance-header-title {
  font-size: var(--text-sm); font-weight: 700; color: var(--color-text-2);
  display: flex; align-items: center; gap: var(--s2);
}
.compliance-badge-pass {
  font-size: var(--text-xs); font-weight: 700;
  color: var(--green-700); background: var(--green-100);
  padding: 3px 10px; border-radius: var(--r-full); border: 1px solid #bbf7d0;
}
.compliance-badge-warn { color: var(--amber-700); background: var(--amber-100); }
.compliance-badge-fail { color: var(--red-700); background: var(--red-100); }
.compliance-body {
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: 0 0 var(--r-md) var(--r-md);
  padding: var(--s4) var(--s5);
}
.compliance-check {
  display: flex; align-items: flex-start; gap: var(--s3);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--slate-100);
}
.compliance-check:last-child { border-bottom: none; }
.check-icon {
  width: 24px; height: 24px; border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: .75rem; font-weight: 700;
}
.check-icon.pass { background: var(--green-100); color: var(--green-700); }
.check-icon.fail { background: var(--red-100); color: var(--red-700); }
.check-icon.warn { background: var(--amber-100); color: var(--amber-700); }
.check-icon.pending { background: var(--slate-100); color: var(--slate-400); }
.check-text { flex: 1; min-width: 0; }
.check-name { font-size: var(--text-sm); font-weight: 600; color: var(--color-text); line-height: 1.3; }
.check-detail { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; line-height: 1.4; }
.check-action {
  display: inline-block; margin-top: var(--s1);
  font-size: var(--text-xs); font-weight: 700;
  color: var(--blue-700); background: var(--blue-50);
  border: 1px solid var(--blue-100);
  padding: 2px 8px; border-radius: var(--r-sm);
}

/* Processing overlay (Phase 7) */
.processing-state {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--s5); padding: var(--s8);
  background: var(--white); border: 1px solid var(--color-border);
  border-radius: var(--r-md);
}
.processing-spinner {
  width: 48px; height: 48px; border-radius: var(--r-full);
  border: 3px solid var(--blue-100); border-top-color: var(--blue-700);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing-title { font-size: var(--text-base); font-weight: 700; color: var(--color-text); }
.processing-checklist { width: 100%; display: flex; flex-direction: column; gap: var(--s3); }
.pcheck {
  display: flex; align-items: center; gap: var(--s3);
  font-size: var(--text-sm); font-weight: 500; color: var(--slate-400);
  transition: color var(--base) var(--ease);
}
.pcheck.done { color: var(--color-text); }
.pcheck-icon { width: 20px; height: 20px; border-radius: var(--r-full); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.pcheck-icon.pending-icon { background: var(--slate-100); color: transparent; }
.pcheck-icon.spin-icon { background: var(--blue-50); color: transparent; position: relative; }
.pcheck-icon.spin-icon::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; border: 2px solid var(--blue-200); border-top-color: var(--blue-700); animation: spin .7s linear infinite; }
.pcheck-icon.done-icon { background: var(--green-100); color: var(--green-700); }

/* --------------------------------------------------------------------------
   EXPORT / DOWNLOAD STATE (Phase 8)
   -------------------------------------------------------------------------- */
.export-panel { padding: var(--s6); }
.export-ready {
  text-align: center; padding: var(--s6) 0 var(--s4);
}
.export-tick {
  width: 64px; height: 64px; border-radius: var(--r-full);
  background: var(--green-50); border: 2px solid #86efac;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--s4); font-size: 1.75rem;
}
.export-headline { font-size: var(--text-xl); font-weight: 800; color: var(--color-text); letter-spacing: -.02em; margin-bottom: 4px; }
.export-subline  { font-size: var(--text-sm); color: var(--color-text-muted); }
.export-preview {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--s4); margin: var(--s6) 0;
}
.preview-block { text-align: center; }
.preview-thumb {
  width: 100%; aspect-ratio: 1;
  background: var(--slate-100); border-radius: var(--r-md);
  border: 1px solid var(--color-border); overflow: hidden;
  margin-bottom: var(--s2); display: flex; align-items: center; justify-content: center;
}
.preview-thumb img, .preview-thumb canvas { width: 100%; height: 100%; object-fit: cover; }
.preview-label { font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.export-actions { display: flex; flex-direction: column; gap: var(--s3); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 13px var(--s6);
  font-family: var(--font); font-size: var(--text-base); font-weight: 700;
  border-radius: var(--r-md); border: none; text-decoration: none;
  white-space: nowrap; line-height: 1.4; cursor: pointer;
  transition: all var(--fast) var(--ease); position: relative;
}
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-w { width: 100%; }
.btn-primary { background: var(--blue-700); color: #fff; box-shadow: var(--shadow-btn); }
.btn-primary:hover:not(:disabled) { background: var(--blue-800); box-shadow: var(--shadow-btn-hover); transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-outline { background: var(--white); color: var(--color-text); border: 1.5px solid var(--color-border); }
.btn-outline:hover:not(:disabled) { border-color: var(--slate-300); background: var(--slate-50); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--color-text-muted); font-size: var(--text-sm); font-weight: 600; }
.btn-ghost:hover { color: var(--color-text); background: var(--slate-100); }
.btn-icon-l { font-size: 1.1em; }

/* --------------------------------------------------------------------------
   TRUST SECTION (Phase 9)
   -------------------------------------------------------------------------- */
.trust-section { padding: var(--s12) 0; }
.trust-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--s4);
}
.trust-card {
  background: var(--white); border: 1px solid var(--color-border);
  border-radius: var(--r-lg); padding: var(--s5);
  display: flex; flex-direction: column; gap: var(--s3);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--base) var(--ease), transform var(--base) var(--ease);
}
.trust-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.trust-card-icon {
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--blue-50); display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.trust-card-title { font-size: var(--text-sm); font-weight: 700; color: var(--color-text); }
.trust-card-desc  { font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.5; }

/* --------------------------------------------------------------------------
   SECTION SCAFFOLD
   -------------------------------------------------------------------------- */
.page-section { padding: var(--s12) 0; }
.page-section + .page-section { padding-top: 0; }
.section-head { text-align: center; margin-bottom: var(--s8); }
.section-title {
  font-size: clamp(var(--text-xl), 3vw, var(--text-3xl));
  font-weight: 800; color: var(--color-text); letter-spacing: -.03em; line-height: 1.2;
  margin-bottom: var(--s2);
}
.section-sub { font-size: var(--text-base); color: var(--color-text-muted); max-width: 560px; margin: 0 auto; }

/* Specs Table */
.specs-table-card { background: var(--white); border: 1px solid var(--color-border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.specs-table { width: 100%; border-collapse: collapse; }
.specs-table th, .specs-table td { padding: var(--s4) var(--s5); text-align: left; font-size: var(--text-sm); border-bottom: 1px solid var(--color-border); }
.specs-table tr:last-child th, .specs-table tr:last-child td { border-bottom: none; }
.specs-table th { font-weight: 600; color: var(--color-text-muted); background: var(--slate-50); width: 40%; }
.specs-table td { font-weight: 500; color: var(--color-text); }

/* How-To */
.howto-grid { display: grid; grid-template-columns: 1fr; gap: var(--s4); }
.howto-card {
  background: var(--white); border: 1px solid var(--color-border);
  border-radius: var(--r-lg); padding: var(--s5);
  display: flex; gap: var(--s4); box-shadow: var(--shadow-card);
  transition: all var(--base) var(--ease);
}
.howto-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.howto-num {
  width: 40px; height: 40px; min-width: 40px;
  border-radius: var(--r-md); background: var(--blue-50);
  color: var(--blue-700); display: flex; align-items: center; justify-content: center;
  font-size: var(--text-lg); font-weight: 800;
}
.howto-card h3 { font-size: var(--text-base); font-weight: 700; color: var(--color-text); margin-bottom: 4px; }
.howto-card p  { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.5; }

/* FAQ Accordion */
.accordion { display: flex; flex-direction: column; gap: var(--s3); }
.accordion-item {
  background: var(--white); border: 1px solid var(--color-border);
  border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: border-color var(--fast) var(--ease);
}
.accordion-item:hover { border-color: var(--slate-300); }
.accordion-item.active { border-color: var(--blue-500); box-shadow: 0 0 0 1px var(--blue-100), var(--shadow-md); }
.accordion-header {
  padding: var(--s4) var(--s5); cursor: pointer;
  font-size: var(--text-base); font-weight: 600; color: var(--color-text);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  user-select: none; margin: 0; transition: background var(--fast) var(--ease);
}
.accordion-header:hover { background: var(--slate-50); }
.accordion-header::after {
  content: '+'; font-size: var(--text-xl); font-weight: 400;
  color: var(--color-text-muted); flex-shrink: 0; transition: transform var(--base) var(--ease);
}
.accordion-item.active .accordion-header::after { content: '−'; color: var(--blue-700); transform: rotate(180deg); }
.accordion-content { max-height: 0; overflow: hidden; transition: max-height var(--slow) var(--ease); }
.accordion-item.active .accordion-content { max-height: 400px; }
.accordion-body { padding: 0 var(--s5) var(--s5); font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.65; }

/* Country Links Grid */
.countries-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s3); list-style: none; }
.countries-grid a {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s4); background: var(--white);
  border: 1px solid var(--color-border); border-radius: var(--r-md);
  font-size: var(--text-sm); font-weight: 500; color: var(--color-text);
  transition: all var(--fast) var(--ease); box-shadow: var(--shadow-sm);
}
.countries-grid a::before { content: '→'; color: var(--color-text-muted); transition: color var(--fast) var(--ease); }
.countries-grid a:hover { border-color: var(--blue-500); color: var(--blue-700); background: var(--blue-50); }
.countries-grid a:hover::before { color: var(--blue-700); }

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  padding: var(--s8) 0; text-align: center;
  border-top: 1px solid var(--color-border); background: var(--white);
}
.footer-text { font-size: var(--text-sm); color: var(--color-text-muted); font-weight: 500; }

/* --------------------------------------------------------------------------
   STATE CONTAINERS
   -------------------------------------------------------------------------- */
.state-pane { display: none; }
.state-pane.active-state { display: block; animation: fadeUp var(--slow) var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --------------------------------------------------------------------------
   TOAST
   -------------------------------------------------------------------------- */
.app-toast {
  position: fixed; top: var(--s5); left: 50%; transform: translateX(-50%);
  background: var(--slate-800); color: #fff;
  padding: 12px var(--s6); border-radius: var(--r-md);
  font-family: var(--font); font-weight: 500; font-size: var(--text-sm);
  z-index: 9999; box-shadow: var(--shadow-xl);
  animation: toastIn var(--base) var(--ease);
  white-space: nowrap; max-width: calc(100vw - 40px);
}
.app-toast.error { background: #dc2626; }
.app-toast.success { background: var(--green-600); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* --------------------------------------------------------------------------
   RESPONSIVE — TABLET+
   -------------------------------------------------------------------------- */
@media (min-width: 640px) {
  .howto-grid { grid-template-columns: repeat(2, 1fr); }
  .export-preview { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 768px) {
  .tool-body { padding: var(--s8); }
  .hero { padding: var(--s16) 0 calc(var(--s20) + 60px); }
  .canvas-shell { min-height: 380px; }
  .trust-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --------------------------------------------------------------------------
   RESPONSIVE — MOBILE OVERRIDES
   -------------------------------------------------------------------------- */
@media (max-width: 639px) {
  :root {
    --s8:  1.5rem; --s10: 2rem;
    --s12: 2.5rem; --s16: 3rem; --s20: 4rem;
  }
  .hero { padding: var(--s8) 0 calc(var(--s12) + 50px); }
  .hero-title { font-size: var(--text-2xl); }
  .hero-subtitle { font-size: var(--text-base); }
  .hero-trust { gap: var(--s3); }
  .trust-item { font-size: var(--text-xs); }
  .step-label { font-size: 9px; }
  .step-dot { width: 28px; height: 28px; font-size: var(--text-xs); }
  .tool-body { padding: var(--s5); }
  .tool-card { border-radius: var(--r-lg); }
  .upload-zone { padding: var(--s8) var(--s5); min-height: 220px; }
  .upload-icon-ring { width: 56px; height: 56px; }
  .canvas-shell { min-height: 240px; }
  .export-preview { grid-template-columns: 1fr 1fr; gap: var(--s3); }
  .howto-card { flex-direction: row; }
}

/* --------------------------------------------------------------------------
   PRINT
   -------------------------------------------------------------------------- */
@media print {
  .site-header, .hero, .tool-lift, .site-footer { display: none; }
}


.pp-guides {
  background: linear-gradient(180deg, #fffaf5 0%, #ffffff 100%);
  padding: 64px 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1f2937;
  contain: layout style;
}

.pp-guides__container {
  max-width: 1200px;
  margin: 0 auto;
}

.pp-guides__header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 48px;
}

.pp-guides__eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ea580c;
  background: #fff1e6;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.pp-guides__title {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.2;
  color: #0f172a;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

.pp-guides__intro {
  font-size: 16px;
  line-height: 1.65;
  color: #475569;
  margin: 0;
}

.pp-guides__grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.pp-card {
  display: flex;
  min-height: 100%;
}

.pp-card__link {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #f1e6da;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
  isolation: isolate;
}

.pp-card__link::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #f97316, #ea580c);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
  z-index: 1;
}

.pp-card__link:hover,
.pp-card__link:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(234, 88, 12, 0.12);
  border-color: #fed7aa;
}

.pp-card__link:hover::before,
.pp-card__link:focus-visible::before {
  transform: scaleX(1);
}

.pp-card__link:focus-visible {
  outline: 2px solid #ea580c;
  outline-offset: 3px;
}

.pp-card__flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 24px;
  background: #fff7ed;
  border-radius: 10px;
  margin-bottom: 16px;
  line-height: 1;
}

.pp-card__title {
  font-size: 17px;
  font-weight: 650;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 8px;
  line-height: 1.35;
}

.pp-card__desc {
  font-size: 14px;
  line-height: 1.55;
  color: #64748b;
  margin: 0 0 20px;
  flex-grow: 1;
}

.pp-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #ea580c;
  margin-top: auto;
}

.pp-card__cta span {
  transition: transform 0.2s ease;
  display: inline-block;
}

.pp-card__link:hover .pp-card__cta span,
.pp-card__link:focus-visible .pp-card__cta span {
  transform: translateX(4px);
}

@media (max-width: 640px) {
  .pp-guides {
    padding: 48px 16px;
  }

  .pp-guides__header {
    margin-bottom: 32px;
  }

  .pp-guides__grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .pp-card__link {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pp-card__link,
  .pp-card__link::before,
  .pp-card__cta span {
    transition: none;
  }

  .pp-card__link:hover,
  .pp-card__link:focus-visible {
    transform: none;
  }
}


