@font-face {
  font-family: "Lexend";
  font-weight: 300 600;
  font-display: swap;
  src: url(/static/lexend-latin.woff2) format("woff2");
}

:root {
  --gs-green: #1D403C;      /* Green and Spiegel dark green */
  --gs-green-hover: #2a5a54;
  --gs-mint: #95D1B6;       /* Green and Spiegel mint */
  --gs-mint-soft: #e6f4ed;
  --gs-grey: #DBDBDB;
  --text: #1f2a28;
  --muted: #5b6764;
  --bg: #f4f7f5;
  --card: #ffffff;
  --error: #b42318;
  --error-soft: #fdecea;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--card);
  border-bottom: 4px solid var(--gs-mint);
}
header .inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
header img { height: 40px; width: auto; display: block; }
header .user { font-size: 14px; color: var(--muted); text-align: right; }
header .user a { color: var(--gs-green); font-weight: 500; }

main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

footer {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding: 20px;
}

h1 { font-size: 28px; font-weight: 600; color: var(--gs-green); margin: 0 0 8px; }
h2 { font-size: 18px; font-weight: 600; color: var(--gs-green); margin: 0 0 4px; }
p.lead { color: var(--muted); margin: 0 0 28px; font-size: 16px; }
.muted { color: var(--muted); font-size: 14px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(29, 64, 60, .08), 0 8px 24px rgba(29, 64, 60, .06);
  padding: 28px;
  margin-bottom: 20px;
}
.card.center { text-align: center; padding: 48px 28px; }

.step { display: flex; gap: 16px; align-items: flex-start; }
.step + .step { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--gs-grey); }
.step .num {
  flex: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gs-mint);
  color: var(--gs-green);
  font-weight: 600;
  display: grid; place-items: center;
}
.step.disabled { opacity: .45; pointer-events: none; }
.step .body { flex: 1; min-width: 0; }

label { display: block; font-weight: 500; margin: 12px 0 6px; font-size: 15px; }
label.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
label.checkbox input { width: 18px; height: 18px; margin: 0; accent-color: var(--gs-green); }
input[type=text], select {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border: 1.5px solid var(--gs-grey);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
input[type=text]:focus, select:focus, button:focus-visible, .dropzone:focus-visible {
  outline: none;
  border-color: var(--gs-green);
  box-shadow: 0 0 0 4px rgba(149, 209, 182, .55);
}
.row { display: flex; gap: 10px; }
.row > input { flex: 1; }

button, .button {
  font: inherit;
  font-weight: 500;
  font-size: 16px;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  cursor: pointer;
  background: var(--gs-green);
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
button:hover, .button:hover { background: var(--gs-green-hover); }
button:disabled { background: #9aa8a5; cursor: not-allowed; }
button.secondary { background: var(--gs-mint-soft); color: var(--gs-green); }
button.secondary:hover { background: var(--gs-mint); }
button.big, .button.big { width: 100%; padding: 16px; font-size: 17px; margin-top: 20px; }
button.link { background: none; color: var(--gs-green); padding: 0; text-decoration: underline; font-weight: 400; font-size: 14px; }

.alert {
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 14px;
  font-size: 15px;
}
.alert.error { background: var(--error-soft); color: var(--error); }
.alert.info { background: var(--gs-mint-soft); color: var(--gs-green); }
.hidden { display: none !important; }

.matter-box {
  margin-top: 14px;
  background: var(--gs-mint-soft);
  border-left: 4px solid var(--gs-mint);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 15px;
}
.matter-box strong { color: var(--gs-green); }

.link-box {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.link-box input { flex: 1; font-size: 14px; font-family: ui-monospace, monospace; background: var(--bg); }

/* Upload page */
.dropzone {
  border: 2px dashed var(--gs-mint);
  background: var(--gs-mint-soft);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.dropzone:hover, .dropzone.over { background: #d3ecdf; border-color: var(--gs-green); }
.dropzone .icon { width: 48px; height: 48px; margin: 0 auto 10px; color: var(--gs-green); }
.dropzone strong { color: var(--gs-green); font-size: 18px; display: block; }

ul.files { list-style: none; padding: 0; margin: 20px 0 0; }
ul.files li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--gs-grey);
  border-radius: 10px;
  margin-bottom: 8px;
  background: #fff;
}
ul.files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ul.files .size { color: var(--muted); font-size: 13px; flex: none; }
ul.files .remove { background: none; color: var(--muted); padding: 4px 8px; font-size: 20px; line-height: 1; }
ul.files .remove:hover { color: var(--error); background: none; }
ul.files .state { font-size: 13px; flex: none; font-weight: 500; }
ul.files .state.ok { color: var(--gs-green); }
ul.files .state.bad { color: var(--error); }
.progress { height: 6px; background: var(--gs-grey); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.progress > div { height: 100%; width: 0; background: var(--gs-green); transition: width .2s; }
.file-main { flex: 1; min-width: 0; }

.check {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--gs-mint);
  color: var(--gs-green);
  display: grid; place-items: center;
  margin: 0 auto 20px;
}

.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  h1 { font-size: 23px; }
  .card { padding: 20px; }
  header img { height: 30px; }
  .row, .link-box { flex-direction: column; }
  .step { gap: 12px; }
}

.alert:empty { display: none; }
.narrow { max-width: 320px; }
.mt { margin-top: 16px; }
.flush { margin: 0; }
.center-text { text-align: center; }

form.inline { display: inline; margin: 0; }
button.signout { background: none; color: var(--gs-green); padding: 0; font-size: 14px; font-weight: 500; text-decoration: underline; }
button.signout:hover { background: none; }
.spinner.dark { width: 30px; height: 30px; margin: 0 auto 18px; border-color: var(--gs-mint-soft); border-top-color: var(--gs-green); }

/* ---------- Motion ---------- */
:root { --ease: cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.5); } 60% { opacity: 1; transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@keyframes leave { to { opacity: 0; transform: translateX(24px); } }
@keyframes draw { from { stroke-dashoffset: 22; } to { stroke-dashoffset: 0; } }

button, .button, input[type=text], select, .dropzone, .step, .step .num {
  transition: background-color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease),
              color .2s var(--ease), opacity .3s var(--ease), transform .15s var(--ease);
}
button:not(:disabled):hover, .button:hover { transform: translateY(-1px); }
button:not(:disabled):active, .button:active { transform: translateY(0) scale(.97); }
button.link:hover, button.signout:hover, ul.files .remove:hover { transform: none; }

/* Sections, cards and messages ease in whenever they appear */
main > section, .matter-box, .alert { animation: rise .35s var(--ease) both; }
.alert.error { animation: rise .3s var(--ease) both, shake .35s .1s var(--ease); }
.step.enter { animation: rise .4s var(--ease) both; }
.step.disabled .num { transform: scale(.85); }

.hint { margin: 14px 0 0; padding: 12px 16px; border-radius: 10px; background: var(--gs-mint-soft); color: var(--gs-green); font-size: 15px; }

/* CC and client-number boxes open and close smoothly */
.collapse {
  display: grid; grid-template-rows: 1fr; opacity: 1;
  transition: grid-template-rows .3s var(--ease), opacity .25s var(--ease), visibility .3s;
}
.collapse > div { overflow: hidden; padding: 0 4px 4px; margin: 0 -4px -4px; }
.collapse.collapsed { grid-template-rows: 0fr; opacity: 0; visibility: hidden; }

/* Success ticks */
.tick, .check { animation: pop .5s .1s var(--ease) both; }
.check path { stroke-dasharray: 22; animation: draw .4s .45s var(--ease) both; }

/* Upload page file list */
ul.files li.enter { animation: rise .3s var(--ease) both; }
ul.files li.leave { animation: leave .22s var(--ease) forwards; }
.dropzone.over { transform: scale(1.01); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important;
  }
  button:hover, button:active, .button:hover, .dropzone.over { transform: none !important; }
  .spinner { animation-duration: 1.6s !important; }
}

/* Page content eases in on load */
main > * { animation: rise .45s var(--ease) both; }
main > *:nth-child(2) { animation-delay: .06s; }
main > *:nth-child(3) { animation-delay: .12s; }
