/* Volunteer application (volunteer.jcfoodpantry.org). Colors match the
   JCFP Connect app (lib/theme.dart). */

:root {
  --theme: #eb4000;
  --theme-dark: #c93700;
  --theme-soft: rgba(235, 64, 0, 0.09);
  --theme-line: rgba(235, 64, 0, 0.35);
  --cream: #fbf9f2;
  --ink: #19293d;
  --secondary: #5f6670;
  --line: #cfd2d8;
  --line-soft: #e8e6df;
  --card: #ffffff;
  --green: #22a447;
  --red: #d70015;
  --red-soft: #fff1f0;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--card);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--theme); }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 3px solid var(--theme-line); outline-offset: 2px; }

/* ---------------------------------------------------------------- layout */

.layout { position: relative; min-height: 100vh; min-height: 100dvh; }

.layout.split {
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(0, 1fr);
}

.side {
  background: var(--cream);
  padding: 56px 32px 40px;
  display: flex;
  justify-content: center;
}

.side-inner { width: 100%; max-width: 400px; position: sticky; top: 56px; align-self: flex-start; }

.main {
  position: relative;
  padding: 72px 40px 40px;
  display: flex;
  justify-content: center;
}

.main-inner {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 112px);
  min-height: calc(100dvh - 112px);
}

.close {
  position: absolute;
  z-index: 10;          /* above the right-hand panel, which comes later in the page */
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  text-decoration: none;
}
.close:hover { background: var(--line-soft); }
.close svg { width: 22px; height: 22px; }

/* ----------------------------------------------------------------- brand */

.brand { text-align: center; }

.logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: block;
  margin: 0 auto 18px;
  box-shadow: 0 2px 8px rgba(25, 41, 61, 0.12);
}

.brand h1 { font-size: 20px; line-height: 1.3; margin: 0 0 6px; }

.brand p { margin: 0; color: var(--secondary); font-size: 15px; }

.brand p strong { color: var(--theme); font-weight: 500; }

/* ----------------------------------------------------------------- steps */

.steps { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 10px; }

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 9px 16px 9px 9px;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(25, 41, 61, 0.06);
  text-align: left;
  cursor: default;
}

button.step { cursor: pointer; }
button.step:hover .step-label { text-decoration: underline; }

.step-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink);
}
.step-icon svg { width: 18px; height: 18px; }

.step-text { flex: 1; min-width: 0; }

.step-label { display: block; font-size: 15px; }

.step-sub {
  display: block;
  font-size: 12px;
  color: var(--secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step.current .step-icon { border-color: var(--theme); color: var(--theme); }
.step.current .step-label { color: var(--theme); font-weight: 500; }

.step.locked { opacity: 0.55; }

.check { flex: none; width: 20px; height: 20px; color: var(--green); }

.avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(160deg, #ffb340, #ff8a00);
  display: grid;
  place-items: center;
  color: #fff;
}
.avatar svg { width: 22px; height: 22px; }

.step.account .step-label { font-weight: 600; font-size: 14px; }

.review-badge {
  margin-top: 12px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--theme-soft);
  border: 1px solid rgba(235, 64, 0, 0.12);
  color: var(--ink);
  font-size: 13px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.review-badge svg { width: 15px; height: 15px; }
.review-badge.approved { background: rgba(34, 164, 71, 0.1); border-color: rgba(34, 164, 71, 0.2); }
.review-badge.denied { background: #f2f2f4; border-color: var(--line-soft); }

/* Phones: a compact header instead of the step list. */
.progress { display: none; }

/* ------------------------------------------------------------- content */

.main h2 { font-size: 24px; line-height: 1.25; margin: 0 0 14px; }

.main h2.center { text-align: center; }

.lead { color: var(--secondary); margin: 0 0 24px; }

.content { flex: 1; }

.banner {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--red-soft);
  color: var(--red);
  font-size: 15px;
}
.banner.info { background: var(--theme-soft); color: var(--ink); }

/* ----------------------------------------------------------------- fields */

.field { margin: 0 0 20px; }

.field > label, .field > .label, legend.label {
  display: block;
  font-size: 14px;
  margin: 0 0 6px;
  padding: 0;
}

.req { color: var(--theme); margin-left: 2px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  font-size: 16px;
  transition: border-color 0.15s;
}
.input::placeholder { color: #9aa0a8; }
.input:hover { border-color: #aeb3ba; }
.input:focus { outline: none; border-color: var(--theme); box-shadow: 0 0 0 3px var(--theme-soft); }
textarea.input { min-height: 88px; resize: vertical; }

.invalid .input, .invalid .multi-button, .input[aria-invalid="true"] { border-color: var(--red); }

.error { color: var(--red); font-size: 13px; margin: 6px 0 0; }

.hint { color: var(--secondary); font-size: 12px; margin: 4px 0 0 2px; }

.phone { display: flex; align-items: stretch; }
.phone .prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  background: var(--cream);
  color: var(--secondary);
  font-size: 15px;
}
.phone .input { border-radius: 0 6px 6px 0; }

.password { position: relative; }
.password .input { padding-right: 64px; }
.show-password {
  position: absolute;
  right: 6px;
  top: 6px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  background: none;
  color: var(--theme);
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
}

.section-title {
  border-top: 1px solid var(--line-soft);
  margin: 28px 0 18px;
  padding-top: 24px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

/* Multi-select drop-down with checkboxes */
.multi { position: relative; }

.multi-button {
  width: 100%;
  min-height: 48px;
  padding: 11px 44px 11px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  text-align: left;
  cursor: pointer;
  position: relative;
  font-size: 16px;
}
.multi-button:hover { border-color: #aeb3ba; }
.multi-button[aria-expanded="true"] { border-color: var(--theme); box-shadow: 0 0 0 3px var(--theme-soft); }
.multi-button .placeholder { color: var(--ink); }
.multi-button svg {
  position: absolute; right: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  transition: transform 0.15s;
}
.multi-button[aria-expanded="true"] svg { transform: rotate(180deg); }

.multi-panel {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 320px;
  overflow: auto;
  padding: 8px 0;
  background: var(--card);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(25, 41, 61, 0.16), 0 0 0 1px rgba(25, 41, 61, 0.06);
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 15px;
}
.option:hover { background: var(--cream); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--theme-soft);
  font-size: 13px;
}

/* Checkboxes */
input[type="checkbox"] {
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  border: 1.5px solid #8e939a;
  border-radius: 5px;
  background: var(--card);
  display: grid;
  place-items: center;
  cursor: pointer;
}
input[type="checkbox"]::after {
  content: "";
  width: 11px;
  height: 6px;
  border: solid #fff;
  border-width: 0 0 2.5px 2.5px;
  transform: translateY(-1px) rotate(-45deg);
  opacity: 0;
}
input[type="checkbox"]:checked { background: var(--theme); border-color: var(--theme); }
input[type="checkbox"]:checked::after { opacity: 1; }
input[type="checkbox"]:disabled { cursor: not-allowed; opacity: 0.45; }

.agree { display: flex; gap: 10px; align-items: flex-start; margin: 22px 0 0; font-size: 15px; cursor: pointer; }
.agree.disabled { color: var(--secondary); cursor: not-allowed; }

/* PDF card */
.doc {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  padding: 10px 14px 10px 10px;
  border-radius: var(--radius);
  background: #f6f6f8;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid transparent;
}
.doc:hover { border-color: var(--line); background: #f1f1f4; }
.doc .pdf-icon { flex: none; width: 34px; height: 40px; }
.doc-text { min-width: 0; }
.doc-title { display: block; font-weight: 600; font-size: 14px; }
.doc-file { display: block; font-size: 12px; color: var(--secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc .open-icon { flex: none; width: 20px; height: 20px; color: var(--secondary); margin-left: 8px; }
.opened { font-size: 13px; color: var(--green); margin: 8px 0 0 2px; }

/* --------------------------------------------------------------- buttons */

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
  padding-bottom: 8px;
}
.actions.single { grid-template-columns: 1fr; }

.btn {
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 6px;
  border: 1px solid var(--theme);
  background: var(--theme);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s;
}
.btn:hover { background: var(--theme-dark); border-color: var(--theme-dark); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--ink); }
.btn.secondary:hover { background: var(--cream); }
.btn.inline { display: inline-flex; padding: 12px 24px; }

.link-button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--theme);
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
}

.switch { text-align: center; color: var(--secondary); font-size: 15px; margin: 20px 0 0; }

.small { font-size: 13px; color: var(--secondary); }

.captcha { margin: 4px 0 20px; min-height: 65px; }

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

/* ------------------------------------------------------- finished / status */

.finished { max-width: 640px; margin: 0 auto; padding: 120px 20px 60px; text-align: center; }

.illustration { width: 76px; height: 64px; margin: 0 auto 14px; display: block; }

.finished h2 { margin: 0 0 10px; font-size: 26px; }

.finished > p { color: var(--secondary); margin: 0 0 18px; }

.next-list { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 10px; text-align: left; }
.next-list li {
  position: relative;
  padding: 14px 18px 14px 40px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  font-size: 15px;
}
.next-list li::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 22px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--theme);
}

.status-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 20px;
  margin: 0 0 20px;
}
.status-card h3 { margin: 0 0 6px; font-size: 17px; }
.status-card p { margin: 0; color: var(--secondary); }

/* Approved: where to get the app */
.stores { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 14px; }
.store {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.qr { width: 160px; height: 160px; max-width: 100%; height: auto; display: block; }
.store-text { display: flex; flex-direction: column; line-height: 1.25; }
.store-for { font-size: 13px; color: var(--secondary); }
.store-name { font-size: 17px; font-weight: 600; }
.store-link { width: 100%; min-height: 42px; padding: 8px 16px; }

.loading { min-height: 100vh; display: grid; place-items: center; color: var(--secondary); }
.loading .spinner { border-color: var(--line); border-top-color: var(--theme); width: 28px; height: 28px; margin: 0 auto 10px; }

.noscript { max-width: 520px; margin: 80px auto; padding: 0 20px; }

/* ----------------------------------------------------------------- phones */

@media (max-width: 899px) {
  .layout.split { display: block; }

  .side { padding: 20px 16px 16px; display: block; border-bottom: 1px solid var(--line-soft); }
  .side-inner { max-width: none; position: static; }

  .brand { display: flex; align-items: center; gap: 12px; text-align: left; }
  .logo { width: 44px; height: 44px; border-radius: 11px; margin: 0; }
  .brand h1 { font-size: 16px; margin: 0; }
  .brand p { font-size: 13px; }

  .steps, .review-badge { display: none; }

  .progress { display: block; margin: 16px 0 0; }
  .progress-text { display: flex; justify-content: space-between; font-size: 13px; color: var(--secondary); margin: 0 0 6px; }
  .progress-text strong { color: var(--theme); font-weight: 600; }
  .bar { height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
  .bar span { display: block; height: 100%; background: var(--theme); border-radius: 3px; }

  .main { padding: 24px 16px 24px; display: block; }
  .main-inner { min-height: 0; max-width: none; }
  .close { top: 18px; right: 12px; }
  .main h2 { font-size: 22px; padding-right: 0; }

  .row { grid-template-columns: 1fr; gap: 0; }
  .stores { gap: 10px; }
  .store { padding: 14px 10px 12px; }
  .actions { gap: 12px; }

  .finished { padding: 72px 16px 40px; }
}
