/* SGfoto web — mobile-first, light, clean. Accent = Mirror Lake blue. */

:root {
  --accent: #0574B5;
  --accent-dark: #045d92;
  --ink: #16232e;
  --ink-soft: #5b6b78;
  --bg: #f2f6f9;
  --card: #ffffff;
  --line: #e3eaf0;
  --danger: #c0392b;
  --radius: 18px;
  --shadow: 0 8px 28px rgba(22, 62, 92, 0.09);
}

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

/* The hidden attribute must always win, even over display:flex rules below. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
    "PingFang SC", "Noto Sans SC", "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(5, 116, 181, 0.10), transparent 60%),
    radial-gradient(900px 480px at -10% 30%, rgba(5, 116, 181, 0.06), transparent 55%),
    var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  max-width: 560px; width: 100%; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-icon { width: 30px; height: 30px; border-radius: 8px; }
.brand-name { font-weight: 700; font-size: 19px; letter-spacing: 0.2px; }
.lang-toggle {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  padding: 6px 14px; border-radius: 999px; font-size: 14px; cursor: pointer;
}

#main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 6px 18px 30px; }

.screen { display: flex; flex-direction: column; gap: 16px; animation: fadein .25s ease; }
.screen[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px;
}

h1.hero-title { font-size: 30px; line-height: 1.2; margin-top: 14px; letter-spacing: -0.3px; }
.hero-sub { color: var(--ink-soft); font-size: 16px; line-height: 1.55; }
h2 { font-size: 22px; line-height: 1.25; }

.sample { display: flex; align-items: center; gap: 10px; justify-content: center; }
.sample-col { display: flex; flex-direction: column; align-items: center; gap: 7px; flex: 1; }
.sample-col img {
  width: 100%; max-width: 170px; aspect-ratio: 35 / 45; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--line);
}
.sample-tag { font-size: 13px; color: var(--ink-soft); }
.sample-arrow { font-size: 22px; color: var(--accent); font-weight: 700; }

.selling { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.selling li { padding-left: 26px; position: relative; font-size: 15px; line-height: 1.45; }
.selling li::before { content: "✓"; position: absolute; left: 4px; color: var(--accent); font-weight: 700; }

.btn {
  border: none; border-radius: 14px; cursor: pointer;
  font-size: 17px; font-weight: 600; font-family: inherit;
  padding: 15px 18px; transition: transform .06s ease, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.985); }
.btn.big { width: 100%; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(5,116,181,.30); }
.btn.primary:hover { background: var(--accent-dark); }
.btn.primary:disabled { background: #a9c6d8; box-shadow: none; cursor: default; }
.btn.secondary { background: #e8f1f7; color: var(--accent-dark); }
.btn.ghost { background: transparent; color: var(--ink-soft); border: 1px dashed var(--line); }

.fine { font-size: 13px; color: var(--ink-soft); line-height: 1.55; }
.fine a { color: var(--accent); }

.back {
  align-self: flex-start; background: none; border: none; color: var(--accent);
  font-size: 16px; cursor: pointer; padding: 4px 0; font-family: inherit;
}

.tabs { display: flex; gap: 8px; }
.tab {
  flex: 1; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-soft); font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.doc-list { padding: 6px; display: flex; flex-direction: column; }
.doc-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 12px; border-bottom: 1px solid var(--line);
  background: none; border-left: none; border-right: none; border-top: none;
  font-family: inherit; font-size: 16px; color: var(--ink);
  cursor: pointer; text-align: left; width: 100%;
}
.doc-item:last-child { border-bottom: none; }
.doc-item .doc-name { font-weight: 600; }
.doc-item .doc-size { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.doc-item:hover { background: #f6fafc; }

.chip-doc {
  align-self: flex-start; background: #e8f1f7; color: var(--accent-dark);
  border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 600;
}

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; min-height: 190px; cursor: pointer; text-align: center;
  border: 1.5px dashed #b9cedd;
}
.drop-icon { font-size: 34px; }
.photo-preview { max-width: 200px; max-height: 260px; border-radius: 12px; border: 1px solid var(--line); }

.tips .tips-title { font-weight: 700; margin-bottom: 8px; font-size: 15px; }
.tips ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.tips li { padding-left: 22px; position: relative; font-size: 14px; color: var(--ink-soft); }
.tips li::before { content: "•"; position: absolute; left: 8px; color: var(--accent); }

.gender-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 15px; }
.seg { display: flex; background: #e8eef3; border-radius: 12px; padding: 3px; }
.seg-btn {
  border: none; background: transparent; padding: 8px 18px; border-radius: 10px;
  font-size: 15px; font-weight: 600; color: var(--ink-soft); cursor: pointer; font-family: inherit;
}
.seg-btn.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.12); }

.consent { padding: 0 2px; }

.progress-wrap { display: flex; flex-direction: column; gap: 12px; padding: 22px 16px; }
.bar { height: 10px; background: #e6edf2; border-radius: 999px; overflow: hidden; }
.bar-fill {
  height: 100%; width: 3%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #3fa3dd);
  transition: width .6s ease;
}
.progress-msg { font-size: 15px; color: var(--ink); min-height: 22px; }

.result-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.result-img {
  max-width: 250px; width: 70%; border-radius: 10px; border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(0,0,0,.10);
}
.spec-chips { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.spec-chips span {
  font-size: 12.5px; background: #eef4f8; color: var(--ink-soft);
  border-radius: 999px; padding: 5px 11px;
}

#payBlock, #paidBlock { display: flex; flex-direction: column; gap: 10px; }

.foot {
  max-width: 560px; width: 100%; margin: 0 auto; padding: 18px 18px 34px;
  display: flex; flex-direction: column; gap: 8px;
}
.links { text-align: center; }

/* Language picker */
.lang-sel {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  padding: 6px 10px; border-radius: 999px; font-size: 14px; cursor: pointer;
  font-family: inherit; -webkit-appearance: none; appearance: none;
}

/* Requirement details (per-document) */
.req { padding: 0; overflow: hidden; }
.req summary {
  padding: 14px 16px; cursor: pointer; font-weight: 600; font-size: 15px;
  color: var(--accent-dark); list-style: none; position: relative;
}
.req summary::-webkit-details-marker { display: none; }
.req summary::after {
  content: "▾"; position: absolute; right: 16px; color: var(--ink-soft);
  transition: transform .15s;
}
.req[open] summary::after { transform: rotate(180deg); }
.req-body { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.req-row { display: flex; gap: 10px; font-size: 14px; line-height: 1.5; }
.req-row .req-label { color: var(--ink-soft); flex: 0 0 92px; }
.req-row .req-val { color: var(--ink); flex: 1; }
.req-swatch {
  display: inline-block; width: 16px; height: 16px; border-radius: 4px;
  border: 1px solid var(--line); vertical-align: -3px; margin-right: 6px;
}
.req-notes { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.req-notes li { font-size: 13.5px; color: var(--ink); line-height: 1.45; }
.req a { color: var(--accent); word-break: break-all; }

/* Crop editor */
.crop-outer { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.crop-box {
  position: relative; overflow: hidden; width: 230px;
  border-radius: 12px; border: 1.5px solid var(--accent);
  background: #eef2f5; touch-action: none; cursor: grab;
  box-shadow: 0 4px 14px rgba(0,0,0,.10);
}
.crop-box:active { cursor: grabbing; }
.crop-box img {
  position: absolute; top: 0; left: 0; transform-origin: 0 0;
  user-select: none; -webkit-user-select: none; pointer-events: none;
  max-width: none;
}
#zoomSlider { width: 80%; accent-color: var(--accent); }

/* Real-face / AI-face chooser */
.face-seg { align-self: center; }
.face-seg .seg-btn { padding: 8px 12px; font-size: 13.5px; }
.warn { color: #a05a00; background: #fff6e8; border-radius: 10px; padding: 8px 12px; }
.center { text-align: center; }

/* Recent photos on the landing screen */
.recent-list { display: flex; flex-direction: column; margin: 4px 0 8px; }
.recent-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 4px; border-bottom: 1px solid var(--line);
  background: none; border-left: none; border-right: none; border-top: none;
  font-family: inherit; font-size: 14.5px; color: var(--ink); cursor: pointer;
  text-align: left; width: 100%;
}
.recent-item:last-child { border-bottom: none; }
.recent-item .r-badge {
  font-size: 12px; border-radius: 999px; padding: 3px 10px; white-space: nowrap;
  background: #eef4f8; color: var(--ink-soft);
}
.recent-item .r-badge.paid { background: #e6f4ea; color: #1e7d3c; }

@media (min-width: 600px) {
  h1.hero-title { font-size: 34px; }
  .crop-box { width: 260px; }
}
