* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
       background: #f5f5f5; color: #333; }
.container { max-width: 900px; margin: 0 auto; padding: 20px; }
h1 { text-align: center; margin: 20px 0; color: #1a1a2e; }
.subtitle { text-align: center; color: #666; margin-bottom: 30px; }

.card { background: white; border-radius: 12px; padding: 24px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1); margin-bottom: 20px; }

.camera-section { text-align: center; }
video, .preview-img { max-width: 100%; border-radius: 8px; background: #000; }
video { width: 100%; max-height: 480px; object-fit: cover; }
.preview-img { max-height: 480px; object-fit: contain; }

.controls { display: flex; gap: 12px; justify-content: center;
            flex-wrap: wrap; margin-top: 16px; }
.btn { padding: 12px 24px; border: none; border-radius: 8px; cursor: pointer;
       font-size: 16px; font-weight: 600; transition: all 0.2s; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #4361ee; color: white; }
.btn-primary:hover:not(:disabled) { background: #3a56d4; }
.btn-success { background: #2ec4b6; color: white; }
.btn-success:hover:not(:disabled) { background: #25a99d; }
.btn-danger { background: #e63946; color: white; }
.btn-danger:hover:not(:disabled) { background: #cf2f3c; }
.btn-outline { background: white; color: #4361ee; border: 2px solid #4361ee; }
.btn-outline:hover:not(:disabled) { background: #f0f3ff; }

.mode-selector { display: flex; gap: 12px; justify-content: center;
                 flex-wrap: wrap; margin-bottom: 20px; }
.mode-option { flex: 1; min-width: 200px; max-width: 280px; padding: 16px;
               border: 2px solid #ddd; border-radius: 10px; cursor: pointer;
               text-align: center; transition: all 0.2s; background: white; }
.mode-option:hover { border-color: #4361ee; }
.mode-option.active { border-color: #4361ee; background: #f0f3ff; }
.mode-option h3 { font-size: 15px; margin-bottom: 6px; }
.mode-option p { font-size: 12px; color: #666; line-height: 1.4; }
.mode-option .mode-tag { display: inline-block; font-size: 11px; padding: 2px 8px;
                         border-radius: 4px; margin-bottom: 8px; font-weight: 600; }
.tag-recommended { background: #d4edda; color: #155724; }
.tag-advanced { background: #fff3cd; color: #856404; }
.tag-strict { background: #e2e3e5; color: #383d41; }

.upload-area { border: 2px dashed #ccc; border-radius: 8px; padding: 40px;
               text-align: center; cursor: pointer; transition: all 0.2s; }
.upload-area:hover { border-color: #4361ee; background: #f8f9ff; }
.upload-area input { display: none; }

.result-section { display: none; }
/* Generated photo gets ~2x the visual weight of the original. The
   passport photo is what the user is paying for; the original is just
   a reference for comparison. */
.result-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 20px;
               align-items: start; }
@media (max-width: 600px) { .result-grid { grid-template-columns: 1fr; } }
.result-grid img { width: 100%; border-radius: 8px; border: 1px solid #eee; }
.result-label { font-weight: 600; margin-bottom: 8px; color: #555; }

.checks-list { list-style: none; margin-top: 16px; }
.checks-list li { padding: 8px 12px; margin: 4px 0; border-radius: 6px; font-size: 14px; }
.check-pass { background: #d4edda; color: #155724; }
.check-fail { background: #f8d7da; color: #721c24; }
/* Auto-fixed: gatekeeper detected a problem but the pipeline
   resolved it (e.g. modnet replaced a non-uniform background).
   Distinct from PASS — communicates "we did something on your
   behalf" — using a soft blue tied to the brand color. */
.check-fixed { background: #e0e8fb; color: #1e3a8a;
               border-left: 3px solid #4361ee; padding-left: 10px; }

/* Hero demo card (above Camera/Upload): before -> after with a
   curved arrow between two figures. */
.hero-demo { padding: 24px 28px; }
.hero-demo-title { font-size: 20px; font-weight: 700; color: #1a1a2e;
                   text-align: center; margin: 0 0 18px; }
.hero-demo-row { display: flex; align-items: center; justify-content: center;
                 gap: 10px; flex-wrap: nowrap; }
.hero-demo-figure { margin: 0; flex: 0 0 auto; text-align: center; }
.hero-demo-figure img {
  height: 220px; width: auto; max-width: 100%;
  border-radius: 8px; border: 1px solid #eee;
  display: block; margin: 0 auto;
}
.hero-demo-figure figcaption { margin-top: 10px; font-size: 13px;
                               color: #444; line-height: 1.4; }
.hero-demo-figure figcaption strong { display: block; color: #1a1a2e;
                                      font-size: 14px; margin-bottom: 2px; }
.hero-demo-figure figcaption span { color: #888; font-size: 12px; }
.hero-demo-arrow { flex: 0 0 auto; }
.hero-demo-arrow svg { display: block; }
.hero-demo-arrow-wide svg { width: 110px; height: 64px; }
.hero-demo-arrow-narrow { display: none; }
.hero-demo-arrow-narrow svg { width: 56px; height: 80px; }

@media (max-width: 700px) {
  .hero-demo { padding: 18px 16px; }
  .hero-demo-row { flex-direction: column; gap: 6px; }
  .hero-demo-arrow-wide { display: none; }
  .hero-demo-arrow-narrow { display: block; }
  .hero-demo-figure img { height: auto; max-width: 240px; }
}

/* Photo Tips section: a non-collapsible info card with extra
   breathing room. */
.photo-tips-card { background: #fffef5; border-left: 4px solid #f0c040;
                   padding: 28px 32px; }
.photo-tips-title { font-size: 20px; font-weight: 700; color: #856404;
                    margin: 0 0 22px; }
.photo-tips-body { font-size: 15px; line-height: 1.85; color: #555; }
.photo-tips-body p { margin-bottom: 14px; }
.photo-tips-body p:last-child { margin-bottom: 0; }

/* Demo blocks: take_photo and sample_*.
   Each row holds 2 or 3 cards at ~200 px each. */
.demo-block { margin: 32px 0; }
.demo-block:first-child { margin-top: 0; }
.demo-heading { font-size: 16px; color: #856404; margin: 0 0 14px;
                font-weight: 700; }
.demo-row { display: grid; gap: 20px;
            grid-template-columns: repeat(2, minmax(0, 1fr)); }
.demo-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) {
  .demo-row, .demo-row-3 { grid-template-columns: 1fr 1fr; }
}
.demo-figure { margin: 0; padding: 12px; background: #fff;
               border: 2px solid #eee; border-radius: 12px; text-align: center; }
.demo-figure.demo-good { border-color: #b6e0c0; }
.demo-figure.demo-bad  { border-color: #f0c0c5; }
.demo-figure img { width: 100%; max-width: 200px; height: auto; display: block;
                   margin: 0 auto; border-radius: 6px; }
.demo-figure figcaption { margin-top: 12px; font-size: 14px; color: #333;
                          line-height: 1.5; font-weight: 600; }
.demo-figure .demo-sub { display: block; font-weight: 400; color: #888;
                         font-size: 12px; margin-top: 4px; }
.demo-badge { display: inline-block; padding: 3px 10px; border-radius: 12px;
              font-size: 12px; font-weight: 700; margin-right: 6px;
              vertical-align: middle; }
.demo-badge-good { background: #d4edda; color: #155724; }
.demo-badge-bad  { background: #f8d7da; color: #721c24; }

.error-box { background: #fff3cd; border: 1px solid #ffc107; border-radius: 8px;
             padding: 16px; margin-top: 16px; display: none; }
.error-box .error-title { font-weight: 700; color: #856404; margin-bottom: 8px; }
.error-box ul { margin-left: 20px; }

.spinner { display: none; text-align: center; padding: 40px; }
.spinner::after { content: ''; display: inline-block; width: 40px; height: 40px;
  border: 4px solid #eee; border-top-color: #4361ee; border-radius: 50%;
  animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.status-text { text-align: center; margin-top: 12px; color: #666; font-size: 14px; }

.proc-step { display: flex; gap: 14px; align-items: center; padding: 12px 0;
             border-left: 3px solid #e0e0e0; margin-left: 16px; padding-left: 20px;
             color: #aaa; transition: all 0.3s; }
.proc-step.active { color: #333; border-left-color: #4361ee; }
.proc-step.done { color: #155724; border-left-color: #2ec4b6; }

.proc-icon { width: 32px; height: 32px; border-radius: 50%; display: flex;
             align-items: center; justify-content: center; font-weight: 700;
             font-size: 14px; flex-shrink: 0; }
.proc-active { background: #4361ee; color: white; animation: pulse-icon 1s infinite; }
.proc-pending { background: #e0e0e0; color: #999; }
.proc-done { background: #2ec4b6; color: white; }

@keyframes pulse-icon { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
