/* ==========================================================================
   Ameron Fotoservice — familie editie
   Warme crème, antraciet tekst, olijf/goud accenten
   ========================================================================== */

:root {
  --bg: #F5F0E8;
  --card: #FFFFFF;
  --text: #2C2C2C;
  --text-soft: #6B6560;
  --text-muted: #8E877F;
  --accent: #7A8B5C;        /* olijfgroen */
  --accent-dark: #5F6E45;
  --gold: #B8985C;
  --border: #E4DCCF;
  --border-soft: #EDE6D9;
  --hover: #EFE7D8;
  --error: #A65050;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.2px;
}

/* ---------- header ---------- */
.site-header {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 28px 32px;
  text-align: center;
}
.logo {
  height: 64px;
  width: auto;
  margin-bottom: 28px;
  display: inline-block;
}
.site-header h1 {
  font-size: 36px;
  line-height: 1.25;
  margin: 0 0 16px;
  font-weight: 500;
}
.site-header .lead {
  font-size: 16px;
  color: var(--text-soft);
  max-width: 520px;
  margin: 0 auto;
}
.link-btn {
  margin: 20px auto 0;
  display: inline-block;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
}
.link-btn:hover { color: var(--accent-dark); }

/* ---------- layout ---------- */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: 0 2px 12px rgba(60, 50, 30, 0.04);
}
#portrait-card {
  padding: 20px 20px;
}
.card h2 {
  font-size: 26px;
  margin: 0 0 12px;
}
.card h3 {
  font-size: 18px;
  margin: 24px 0 12px;
  color: var(--text);
}

.field-label {
  display: block;
  font-size: 14px;
  color: var(--text-soft);
  margin: 20px 0 8px;
  font-weight: 500;
}

/* ---------- upload ---------- */
.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: var(--border-soft);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
  padding: 24px;
  gap: 8px;
}
.file-drop:hover, .file-drop.drag {
  border-color: var(--accent);
  background: #F0EBDC;
}
.file-drop input { display: none; }
.file-drop span { color: var(--text); font-weight: 500; font-size: 16px; }
.file-drop .hint { color: var(--text-muted); font-weight: 400; font-size: 13px; }

.preview-wrap { margin-top: 20px; }
#preview {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  display: block;
  border: 1px solid var(--border);
}

select {
  width: 100%;
  padding: 14px 16px;
  background: #FFF;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
}

.sfeer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
  animation: fadeIn 0.5s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.sfeer-kaart {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  background: var(--border-soft);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.sfeer-kaart:hover {
  border-color: var(--gold);
  background: #F0EBDC;
}
.sfeer-kaart.selected {
  border-color: var(--accent);
  background: #EAF0DA;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(122, 139, 92, 0.2);
}
.sfeer-titel {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 19px;
  font-weight: 500;
  color: var(--text);
}
.sfeer-tekst {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.sfeer-desc {
  font-size: 13px;
  font-style: italic;
  color: var(--text-soft);
  line-height: 1.4;
}
.sfeer-thumb {
  width: 60px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border);
  transition: width 0.25s ease, height 0.25s ease, box-shadow 0.25s ease;
}
.sfeer-kaart:hover .sfeer-thumb {
  width: 90px;
  height: 120px;
  box-shadow: 0 4px 16px rgba(60, 50, 30, 0.15);
}

/* ---------- buttons ---------- */
.primary-btn {
  margin-top: 24px;
  padding: 14px 24px;
  background: var(--accent);
  color: #FFF;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
  font-size: 15px;
  width: 100%;
  transition: background 0.15s;
}
.primary-btn:hover:not(:disabled) { background: var(--accent-dark); }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.primary-btn.big { font-size: 17px; padding: 18px 24px; }

.soft-btn {
  margin: 0;
  padding: 10px 14px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.soft-btn:hover { background: var(--accent); color: #FFF; }

/* ---------- analyse-lijst ---------- */
.soft-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.soft-item {
  padding: 12px 14px;
  background: var(--border-soft);
  border-radius: 8px;
  border-left: 3px solid var(--gold);
}
.soft-item .key {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}
.soft-item .val { font-size: 14px; color: var(--text); }

/* oude face-picker CSS verwijderd — persoon-kiezer gebruikt inline styles + canvas */

.style-confirm {
  padding: 16px 20px;
  background: var(--border-soft);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.style-confirm .eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 600;
}
.style-confirm span:last-child {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 20px;
  color: var(--text);
}

/* ---------- voortgang ---------- */
.progress-wrap { margin-bottom: 24px; }
.progress-text {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 18px;
  color: var(--text-soft);
  text-align: center;
  margin: 0 0 12px;
  font-style: italic;
}
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border-soft);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.5s ease;
}

/* ---------- varianten grid ---------- */
.variants-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.variant-fig {
  margin: 0;
  background: var(--border-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  min-height: 200px;
}
.variant-fig figcaption {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 15px;
  color: var(--text);
  letter-spacing: 0.3px;
}
.variant-fig img {
  width: 100%;
  border-radius: 6px;
  display: block;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: center top;
  background: #F9F4EA;
}
/* "Uw foto" — originele foto volledig tonen, ongeacht oriëntatie */
.variant-fig img.original-photo {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center center;
  background-color: var(--border-soft);
}
.variant-fig .portrait-wrap {
  position: relative;
  flex: 1;
  min-height: 240px;
  overflow: hidden;
  border-radius: 6px;
}
.variant-fig .portrait-wrap img { display: none; }
.variant-fig.loading .portrait-wrap .loader { display: flex; }
.variant-fig.done .portrait-wrap .loader { display: none; }
.variant-fig.done .portrait-wrap img { display: block; }
.variant-fig.failed .portrait-wrap .loader {
  background: #F5E6E3;
  color: var(--error);
  border-color: #E0C0BC;
}
.variant-actions {
  display: flex;
  gap: 6px;
}
.variant-actions .soft-btn {
  flex: 1;
  text-align: center;
  font-size: 12px;
  padding: 6px 8px;
}

.loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F9F4EA;
  border-radius: 6px;
  color: var(--text-muted);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 15px;
  font-style: italic;
  border: 1px dashed var(--border);
  text-align: center;
  padding: 12px;
}
.loader::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin-right: 10px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- correctiemodule ---------- */
.intro {
  font-size: 15px;
  color: var(--text-soft);
  margin: 0 0 20px;
  line-height: 1.55;
}
.select-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.select-variant {
  margin: 0;
  padding: 6px;
  background: var(--border-soft);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s;
  font-family: inherit;
  color: var(--text-soft);
}
.select-variant:hover:not(:disabled) { border-color: var(--gold); }
.select-variant.selected {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(122, 139, 92, 0.2);
  color: var(--accent);
  background: #F0EBDC;
}
.select-variant:disabled { opacity: 0.4; cursor: not-allowed; }
.select-variant img {
  width: 100%;
  border-radius: 4px;
  display: block;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: #F9F4EA;
}
.select-variant span {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 14px;
}

.sub-header {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 18px;
  color: var(--text);
  margin: 24px 0 12px;
}

.correction-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.correction-btn, .recrop-btn {
  margin: 0;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  background: #FFF;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s;
}
.correction-btn:hover:not(:disabled),
.recrop-btn:hover:not(:disabled) {
  background: var(--hover);
  border-color: var(--accent);
}
.correction-btn:disabled, .recrop-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.recrop-btn { border-left: 3px solid var(--gold); }

.custom-correction { margin: 20px 0 0; }
.custom-correction label {
  display: block;
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 8px;
  font-weight: 500;
}
.custom-row { display: flex; gap: 8px; align-items: stretch; }
.custom-row input {
  flex: 1;
  padding: 12px 14px;
  background: #FFF;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
}
.custom-row .primary-btn {
  margin: 0;
  width: auto;
  white-space: nowrap;
  padding: 12px 20px;
}

.correction-result {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.correction-result h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 20px;
  margin: 0 0 16px;
  color: var(--text);
}
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.compare-grid figure {
  margin: 0;
  background: var(--border-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.compare-grid figcaption {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 14px;
  color: var(--text-soft);
}
.compare-grid img { width: 100%; border-radius: 6px; display: block; }
.compare-grid .portrait-wrap { min-height: 200px; position: relative; }
.compare-grid .portrait-wrap img { display: block; }
#correction-download { margin-top: 16px; width: 100%; }

/* ---------- status / foutmeldingen ---------- */
.status {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 22px;
  border-radius: 8px;
  font-size: 14px;
  display: none;
  z-index: 1000;
  max-width: 90vw;
  text-align: center;
  background: var(--card);
  box-shadow: 0 4px 20px rgba(60, 50, 30, 0.15);
  font-family: inherit;
}
.status.show { display: block; }
.status.info { border: 1px solid var(--accent); color: var(--accent-dark); }
.status.loading { border: 1px solid var(--gold); color: var(--text-soft); font-style: italic; }
.status.error { border: 1px solid var(--error); color: var(--error); }

/* ---------- footer ---------- */
.site-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 28px 48px;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}
.privacy {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0 0 8px;
  line-height: 1.6;
}
.signature {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

/* ---------- extra foto's sectie ---------- */
.extra-fotos-sectie h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 20px;
  margin: 0 0 8px;
  color: var(--text);
}
.extra-fotos-tekst {
  font-size: 14px;
  color: var(--text-soft);
  margin: 0 0 16px;
  line-height: 1.55;
}
.extra-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: var(--border-soft);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
  padding: 18px;
  gap: 6px;
}
.extra-drop:hover, .extra-drop.drag {
  border-color: var(--accent);
  background: #F0EBDC;
}
.extra-drop input { display: none; }
.extra-drop span { color: var(--text); font-weight: 500; font-size: 14px; }
.extra-drop .hint { color: var(--text-muted); font-weight: 400; font-size: 12px; }
.extra-tip {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin: 8px 0 0;
  line-height: 1.5;
}
.extra-preview-strip {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.extra-preview-strip .extra-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.extra-preview-strip .extra-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.extra-preview-strip .extra-thumb .extra-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  padding: 0;
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .site-header { padding: 32px 20px 24px; }
  .site-header h1 { font-size: 28px; }
  .card { padding: 24px 20px; }
  .card h2 { font-size: 22px; }
  main { padding: 0 20px 32px; }
  .variants-grid { grid-template-columns: 1fr; }
  .correction-buttons { grid-template-columns: 1fr; }
  .custom-row { flex-direction: column; }
  .custom-row .primary-btn { width: 100%; }
  .select-strip { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .compare-grid { grid-template-columns: 1fr; }
}
