:root {
  --brand: #0A7D3C;        /* DA green */
  --brand-light: #1BA54B;
  --brand-dark: #054F26;
  --accent: #F7C325;       /* DA gold */
  --accent-deep: #e0a90a;
  --ink: #16261c;
  --muted: #6b7d70;
  --bg: #eef4ee;
  --panel: #ffffff;
  --border: #d6e4d9;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(5, 79, 38, 0.10);
  --shadow-lift: 0 18px 44px rgba(5, 79, 38, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
}

/* Soft animated aurora backdrop (very subtle) */
body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 120vh;
  z-index: -1;
  background:
    radial-gradient(42% 42% at 12% 8%,  rgba(27,165,75,0.16), transparent 60%),
    radial-gradient(38% 38% at 88% 4%,  rgba(247,195,37,0.16), transparent 60%),
    radial-gradient(45% 45% at 78% 88%, rgba(10,125,60,0.12), transparent 62%),
    radial-gradient(40% 40% at 20% 92%, rgba(247,195,37,0.10), transparent 60%);
  filter: blur(6px);
  animation: auroraDrift 22s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
  0%   { transform: translate(0,0) scale(1);   }
  50%  { transform: translate(-2.5%, 2%) scale(1.06); }
  100% { transform: translate(2.5%, -2%) scale(1.03); }
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  background: linear-gradient(115deg, var(--brand-light) 0%, var(--brand) 45%, var(--brand-dark) 100%);
  background-size: 220% 220%;
  color: #fff;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.15), 0 8px 26px rgba(5,79,38,0.28);
  border-bottom: 3px solid var(--accent);
  position: relative;
  overflow: hidden;
  animation: headerSheen 14s ease infinite;
}
@keyframes headerSheen {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
/* Slow travelling gloss across the header */
.app-header::after {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: skewX(-18deg);
  animation: headerGloss 7.5s ease-in-out 1.5s infinite;
}
@keyframes headerGloss {
  0%   { left: -60%; }
  55%  { left: 130%; }
  100% { left: 130%; }
}
.brand-logo {
  width: 58px; height: 58px;
  background: #fff;
  border-radius: 16px;
  padding: 6px;
  object-fit: contain;
  box-shadow: 0 6px 16px rgba(0,0,0,0.28);
  animation: logoFloat 5s ease-in-out infinite;
  transition: transform .3s ease;
}
.brand-logo:hover { transform: scale(1.06) rotate(-2deg); }
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
.app-header h1 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: .3px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.subtitle { margin: 3px 0 0; opacity: 0.9; font-size: 0.9rem; }
.app-header > div { position: relative; z-index: 1; }

/* Layout */
.layout {
  max-width: 960px;
  margin: 28px auto;
  padding: 0 20px;
  display: grid;
  gap: 22px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 26px;
  position: relative;
  transition: transform .25s ease, box-shadow .25s ease;
  animation: panelIn .6s cubic-bezier(.22,1,.36,1) both;
}
.panel:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
/* Gold accent strip that grows on hover */
.panel::before {
  content: "";
  position: absolute;
  left: 0; top: 18px; bottom: 18px;
  width: 4px; border-radius: 4px;
  background: linear-gradient(var(--accent), var(--accent-deep));
  transform: scaleY(0);
  transform-origin: center;
  transition: transform .3s ease;
}
.panel:hover::before { transform: scaleY(1); }
.layout .panel:nth-child(1) { animation-delay: .05s; }
.layout .panel:nth-child(2) { animation-delay: .16s; }
.layout .panel:nth-child(3) { animation-delay: .27s; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 1.18rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--brand-light), var(--brand-dark));
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(5,79,38,0.35);
  position: relative;
}
/* Soft pulsing ring on the step badges */
.step-num::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(27,165,75,0.45);
  animation: stepPulse 2.8s ease-out infinite;
}
@keyframes stepPulse {
  0%   { box-shadow: 0 0 0 0 rgba(27,165,75,0.45); }
  70%  { box-shadow: 0 0 0 12px rgba(27,165,75,0); }
  100% { box-shadow: 0 0 0 0 rgba(27,165,75,0); }
}
.tag {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #fff3d6;
  color: #8a6400;
  padding: 3px 9px;
  border-radius: 20px;
}

/* Dropzone */
.dropzone {
  display: block;
  border: 2px dashed #b9c6d8;
  border-radius: var(--radius);
  background: #f7fafd;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
}
.dropzone:hover {
  border-color: var(--brand-light);
  background: #f1f9f3;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(5,79,38,0.10);
}
.dropzone.dragover {
  border-color: var(--accent);
  background: #fffaf0;
  transform: scale(1.015);
  box-shadow: 0 0 0 4px rgba(247,195,37,0.28), 0 12px 30px rgba(224,169,10,0.20);
}
.dropzone-inner { padding: 38px 20px; text-align: center; }
.dz-icon {
  font-size: 2.6rem;
  display: inline-block;
  animation: dzBob 3s ease-in-out infinite;
}
.dropzone:hover .dz-icon { animation-duration: 1.1s; }
@keyframes dzBob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-7px) rotate(-4deg); }
}
.dropzone p { margin: 6px 0; }
.hint { color: var(--muted); font-size: 0.85rem; }

/* File list */
.filelist {
  list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--brand-light) transparent;
}
.filelist::-webkit-scrollbar { width: 8px; }
.filelist::-webkit-scrollbar-thumb { background: var(--brand-light); border-radius: 8px; }
.filelist::-webkit-scrollbar-track { background: transparent; }
.filelist li {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  background: #f7fafd;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  animation: rowIn .38s cubic-bezier(.22,1,.36,1) both;
}
.filelist li:hover {
  transform: translateX(3px);
  background: #fff;
  box-shadow: 0 6px 16px rgba(5,79,38,0.08);
}
@keyframes rowIn {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}
.filelist img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.filelist .role {
  margin-left: auto;
  font-size: 0.72rem; font-weight: 600;
  padding: 3px 9px; border-radius: 20px;
}
.role.event { background: #fff3d6; color: #8a6400; }
.role.general { background: #dff0e2; color: var(--brand); }
.filelist .remove {
  border: none; background: none; cursor: pointer;
  color: var(--muted); font-size: 1.1rem; line-height: 1;
  transition: transform .15s ease, color .15s ease;
}
.filelist .remove:hover { color: #c0392b; transform: scale(1.25) rotate(90deg); }

/* Fields */
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 5px; }
.field input {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 0.95rem; font-family: inherit;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.field input:hover { border-color: var(--brand-light); }
.field input:focus {
  outline: none; border-color: var(--brand-light);
  box-shadow: 0 0 0 4px rgba(27,165,75,.16);
  transform: translateY(-1px);
}

/* Buttons */
.btn {
  border: 1px solid var(--border);
  background: #fff; color: var(--ink);
  padding: 11px 20px; border-radius: 10px;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: background .18s, transform .08s, box-shadow .18s, border-color .18s;
  position: relative;
  overflow: hidden;
}
.btn:hover { background: #f2f6fb; box-shadow: 0 6px 16px rgba(5,79,38,0.08); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary {
  background: linear-gradient(180deg, var(--brand-light), var(--brand));
  color: #fff; border: none; margin-top: 6px;
  box-shadow: 0 8px 20px rgba(5,79,38,0.30), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn.primary:hover {
  background: linear-gradient(180deg, var(--brand-light), var(--brand-dark));
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(5,79,38,0.36), inset 0 1px 0 rgba(255,255,255,0.25);
}
/* Sheen sweep across buttons on hover */
.btn::after {
  content: "";
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-20deg);
  transition: left .6s ease;
}
.btn:hover::after { left: 130%; }
.btn:disabled {
  opacity: 0.5; cursor: not-allowed;
  transform: none !important; box-shadow: none;
}
.btn:disabled::after { display: none; }
.btn.subtle {
  background: transparent; border-color: transparent; color: var(--muted);
  padding: 6px 10px; font-size: 0.85rem;
}
.btn.subtle:hover { background: #fbeceb; color: #b23b2e; border-color: #f3cfca; box-shadow: none; }

.upload-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
}
.upload-actions .count { font-size: 0.85rem; color: var(--muted); }

/* Results */
#step-results { animation: resultsReveal .6s cubic-bezier(.22,1,.36,1) both; }
@keyframes resultsReveal {
  from { opacity: 0; transform: translateY(26px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.results-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.results-head h2 { margin: 0; }
.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 4px 6px 4px 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--brand-light) transparent;
}
.gallery::-webkit-scrollbar { width: 8px; }
.gallery::-webkit-scrollbar-thumb { background: var(--brand-light); border-radius: 8px; }
.gallery::-webkit-scrollbar-track { background: transparent; }
.card {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff;
  box-shadow: 0 4px 14px rgba(5,79,38,0.07);
  transition: transform .25s ease, box-shadow .25s ease;
  animation: cardPop .5s cubic-bezier(.22,1,.36,1) both;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); }
@keyframes cardPop {
  from { opacity: 0; transform: translateY(18px) scale(.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.card canvas { width: 100%; display: block; background: #f0f0f0; }
.card canvas.draggable { cursor: grab; touch-action: none; }
.card canvas.grabbing { cursor: grabbing; }

/* Position editor (drag to reposition + zoom) */
.card-adjust {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: #f7fafd;
}
.card-adjust .adjust-hint {
  font-size: 0.72rem; color: var(--muted); white-space: nowrap;
}
.card-adjust .zoom-range {
  flex: 1; min-width: 0; accent-color: var(--brand);
  cursor: pointer;
}
.card-adjust .reset-pos {
  padding: 4px 8px; font-size: 0.78rem; white-space: nowrap;
}
.card-adjust .reset-pos:hover { background: #f2f6fb; color: var(--brand); border-color: transparent; }

.card-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; }
.card-foot .name { font-size: 0.82rem; color: var(--muted); }
.card-foot a {
  font-size: 0.82rem; font-weight: 600; color: var(--brand); text-decoration: none;
  padding: 4px 10px; border-radius: 8px;
  transition: background .18s, color .18s;
}
.card-foot a:hover { background: var(--brand); color: #fff; }

.app-footer { max-width: 960px; margin: 10px auto 40px; padding: 0 20px; color: var(--muted); font-size: 0.82rem; }
.app-footer code { background: #dff0e2; padding: 1px 5px; border-radius: 4px; }

@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .app-header h1 { font-size: 1.35rem; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
