:root {
  --color-bg: #f8f7f4;
  --color-surface: #ffffff;
  --color-primary: #1c2b4a;
  --color-accent: #d4a853;
  --color-text: #1a1a1a;
  --color-text-muted: #6b7280;
  --color-border: #e5e2dc;
  --color-success: #2d6a4f;
  --color-warning: #b45309;
  --color-danger: #991b1b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

.container { width: min(980px, 92vw); margin: 0 auto; }
.topbar { position: sticky; top: 0; background: rgba(248,247,244,.97); border-bottom: 1px solid var(--color-border); z-index: 10; }
.topbar-inner { min-height: 68px; display: flex; justify-content: space-between; align-items: center; }
.logo { font-weight: 700; color: var(--color-primary); }

.steps { display: flex; gap: 8px; padding: 0 0 14px; }
.step { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--color-border); font-size: 13px; color: var(--color-text-muted); }
.step.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.page { padding: 26px 0 56px; }
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 28px;
}

h1, h2, h3 { margin: 0 0 10px; font-family: "Playfair Display", serif; color: var(--color-primary); }
p { margin: 0; line-height: 1.6; }
.muted { color: var(--color-text-muted); margin-bottom: 16px; }

.form-group { margin-top: 16px; }
label { display: block; font-weight: 500; margin-bottom: 8px; color: var(--color-text-muted); }
input, textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px 16px;
  font: inherit;
  outline: none;
  background: #fff;
}
input:focus, textarea:focus { border-color: var(--color-primary); }
input.invalid { border-color: var(--color-danger); }
small { color: var(--color-text-muted); display: block; margin-top: 6px; }

.dropzone {
  border: 1px dashed var(--color-primary);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  position: relative;
  background: #fbfaf8;
}
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone.dragover { background: #f1efe9; }

.preview-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.thumb {
  border-radius: 10px;
  border: 1px solid var(--color-border);
  overflow: hidden;
  background: #fff;
  min-height: 90px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.btn {
  border-radius: 6px;
  padding: 14px 28px;
  transition: 0.2s;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  display: inline-block;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--color-primary); color: #fff; width: 100%; }
.btn-outline { background: transparent; color: var(--color-primary); border-color: var(--color-primary); width: auto; }

.loader-wrap { text-align: center; padding: 54px; }
.ring {
  width: 70px;
  height: 70px;
  margin: 0 auto 16px;
  border: 5px solid #d8d3c7;
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.report-block { margin-top: 18px; border-top: 1px solid var(--color-border); padding-top: 14px; }
.status { color: var(--color-success); font-weight: 700; }

.action-row { margin: 14px 0; display: flex; gap: 10px; }
.delivered { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.delivered.ok { border-color: #9cd3b9; background: #eef9f2; }

.toast-wrap {
  position: fixed;
  right: 16px;
  top: 16px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #fff;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-success);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 280px;
}
.toast.warn { border-left-color: var(--color-warning); }

.hidden { display: none !important; }

.contact-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); backdrop-filter: blur(4px);
  display: grid; place-items: center; z-index: 40;
}
.contact-card {
  width: min(560px, 92vw); background: var(--color-surface); border-radius: 12px; border: 1px solid var(--color-border);
  box-shadow: 0 16px 34px rgba(0,0,0,.2); padding: 28px; position: relative;
}
.contact-close { position: absolute; right: 12px; top: 8px; border: none; background: transparent; font-size: 28px; cursor: pointer; color: var(--color-text-muted); }
.contact-loader { margin-top: 8px; color: var(--color-primary); }
.contact-success { margin-top: 8px; color: var(--color-success); font-weight: 700; }
.no-scroll { overflow: hidden; }

@media (max-width: 720px) {
  .action-row, .delivered { flex-direction: column; align-items: stretch; }
}
