/* ═══════════════════════════════════════════════════════════════
   HABIBAYAN — BADGE EVIDENCE SUBMISSIONS

   Built entirely from the variables in habibayan-theme.css. No new colours:
   the submission flow should look like the rest of the site, not like a
   feature that was bolted on.

   Loaded on every web page via hooks.py `web_include_css`, because the modal
   opens from both /me and /badges.
   ═══════════════════════════════════════════════════════════════ */

/* ─── modal shell ─── */

.hb-sub-modal {
  max-width: 640px;
}

.hb-sub-eyebrow {
  font-family: 'DM Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--sunset, #E8622A);
  margin-bottom: 4px;
}

.hb-sub-footer {
  align-items: center;
  flex-wrap: wrap;
}

.hb-sub-reward {
  flex: 1 1 240px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-light, #9C9080);
  text-align: left;
}

.hb-sub-reward strong {
  color: var(--ocean, #16213E);
}

/* ─── the requirements panel ─── */

.hb-sub-req {
  background: var(--cream, #FDF6EC);
  border: 1px solid rgba(232, 98, 42, 0.12);
  border-radius: 12px;
  padding: 16px 18px;
}

.hb-sub-req-h {
  font-family: 'DM Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.hb-sub-req-earn { color: var(--sunset, #E8622A); }
.hb-sub-req-evid { color: var(--sky, #0F3460); margin-top: 14px; }

.hb-sub-req ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-mid, #5A5248);
}

.hb-sub-req li { margin-bottom: 5px; }
.hb-sub-req li::marker { color: var(--sunset, #E8622A); }

/* ─── a submission that was sent back ─── */

.hb-sub-sentback {
  background: #FDF4F2;
  border: 1px solid #F3DBD4;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.55;
  color: #7C3D2C;
}

.hb-sub-sentback-h {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #A6371F;
  margin-bottom: 5px;
}

/* ─── fields ─── */

.hb-sub-field textarea {
  padding: 11px 14px;
  border: 1.5px solid rgba(22, 33, 62, 0.1);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--deep, #16213E);
  background: var(--warm-white, #FEFAF4);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hb-sub-field textarea:focus {
  border-color: var(--sunset, #E8622A);
  box-shadow: 0 0 0 3px rgba(232, 98, 42, 0.08);
}

.hb-sub-req-star { color: var(--sunset, #E8622A); }

.hb-sub-help {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-light, #9C9080);
  margin: -2px 0 4px;
}

.hb-sub-count {
  font-size: 11.5px;
  color: var(--text-light, #9C9080);
  text-align: right;
}

.hb-sub-count.over {
  color: #A6371F;
  font-weight: 600;
}

/* ─── file picker ─── */

.hb-sub-drop {
  position: relative;
  border: 1.5px dashed rgba(22, 33, 62, 0.16);
  border-radius: 12px;
  background: var(--warm-white, #FEFAF4);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  color: var(--sunset, #E8622A);
  transition: border-color 0.2s, background 0.2s;
}

.hb-sub-drop:hover,
.hb-sub-drop.over {
  border-color: var(--sunset, #E8622A);
  background: var(--cream, #FDF6EC);
}

.hb-sub-drop.busy { opacity: 0.6; pointer-events: none; }

.hb-sub-drop svg { width: 24px; height: 24px; }

.hb-sub-drop-t {
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--deep, #16213E);
  margin-top: 6px;
}

.hb-sub-drop-s {
  font-size: 11.5px;
  color: var(--text-light, #9C9080);
  margin-top: 3px;
}

.hb-sub-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.hb-sub-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hb-sub-files:not(:empty) { margin-top: 10px; }

.hb-sub-file {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid rgba(22, 33, 62, 0.08);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13px;
  color: var(--deep, #16213E);
}

.hb-sub-file.pending { opacity: 0.6; }
.hb-sub-file svg { width: 17px; height: 17px; color: var(--sky, #0F3460); flex-shrink: 0; }
.hb-sub-file-n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-sub-file-s { font-size: 11.5px; color: var(--text-light, #9C9080); }

.hb-sub-file-x {
  border: 0;
  background: none;
  font-size: 18px;
  line-height: 1;
  color: var(--text-light, #9C9080);
  cursor: pointer;
  padding: 0 2px;
}

.hb-sub-file-x:hover { color: #A6371F; }

/* ─── status on a badge card ─── */

.hb-badge-card-state {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  z-index: 2;
}

.hb-badge-card-state.open { background: #FDF0E4; color: #B4610F; }
.hb-badge-card-state.back { background: #FBEAE6; color: #A6371F; }

.hb-badge-card.can-submit { cursor: pointer; }

.hb-badge-card-cta {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--sunset, #E8622A);
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.hb-badge-card.can-submit:hover .hb-badge-card-cta,
.hb-badge-card.can-submit:focus-visible .hb-badge-card-cta { opacity: 1; }

/* Touch screens have no hover, so the prompt stays visible there. */
@media (hover: none) {
  .hb-badge-card-cta { opacity: 1; }
}

.hb-badge-card.can-submit:focus-visible {
  outline: 2px solid var(--sunset, #E8622A);
  outline-offset: 2px;
}

/* ─── my submissions ─── */

.hb-sub-chip {
  display: inline-flex;
  align-items: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-left: 8px;
}

.hb-sub-chip.open { background: #FDF0E4; color: #B4610F; }
.hb-sub-chip.ok   { background: #E9F3EC; color: #2D6A4F; }
.hb-sub-chip.back { background: #FBEAE6; color: #A6371F; }

.hb-sub-list {
  display: flex;
  flex-direction: column;
}

.hb-sub-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 110px 120px;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 4px;
  border-top: 1px solid rgba(22, 33, 62, 0.07);
}

.hb-sub-row:first-child { border-top: 0; }

.hb-sub-row-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ocean, #16213E);
}

.hb-sub-row-circle,
.hb-sub-row-when {
  font-size: 11.5px;
  color: var(--text-light, #9C9080);
  margin-top: 2px;
}

.hb-sub-row-what {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-mid, #5A5248);
}

.hb-sub-note {
  font-size: 12.5px;
  line-height: 1.5;
  color: #A6371F;
  margin-top: 5px;
}

.hb-sub-again {
  display: inline-block;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--sunset, #E8622A);
  text-decoration: none;
}

.hb-sub-again:hover { color: var(--sunset-dark, #c9511e); }

.hb-sub-pill {
  display: inline-flex;
  font-family: 'DM Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.hb-sub-pill.open { background: #FDF0E4; color: #B4610F; }
.hb-sub-pill.ok   { background: #E9F3EC; color: #2D6A4F; }
.hb-sub-pill.back { background: #FBEAE6; color: #A6371F; }
.hb-sub-pill.idle { background: #F2F0EB; color: #7A7266; }

@media (max-width: 720px) {
  .hb-sub-row {
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
  }
  .hb-sub-row-what { grid-column: 1 / -1; }
  .hb-sub-row-when { grid-column: 1; }
}

/* A circle you have not earned yet is greyed out — but if you can apply for it,
   it should not look switched off. Bring it most of the way back, and all the
   way on hover. */

.hb-badge-card.locked.can-submit {
  opacity: 0.82;
  filter: grayscale(0.3);
  transition: opacity 0.25s, filter 0.25s, transform 0.25s, box-shadow 0.25s;
}

.hb-badge-card.locked.can-submit:hover,
.hb-badge-card.locked.can-submit:focus-visible {
  opacity: 1;
  filter: none;
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(232, 98, 42, 0.12);
  border-color: rgba(232, 98, 42, 0.2);
}

/* ─── the way in, on /badges ─── */

.hb-cd-act {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(22, 33, 62, 0.07);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hb-cd-act-note {
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-light, #9C9080);
}

/* ─── profile photo ─── */

.hb-profile-avatar-wrap { position: relative; }

.hb-profile-avatar.has-photo {
  padding: 0;
  overflow: hidden;
  font-size: 0;
}

.hb-profile-avatar.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hb-profile-avatar.busy { opacity: 0.55; }

.hb-avatar-input { display: none; }

.hb-avatar-edit {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 32px;
  height: 32px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--sunset, #E8622A);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 10px rgba(232, 98, 42, 0.3);
  transition: transform 0.2s, background 0.2s;
  z-index: 3;
}

.hb-avatar-edit:hover { background: var(--sunset-dark, #c9511e); transform: scale(1.06); }
.hb-avatar-edit svg { width: 15px; height: 15px; }

.hb-avatar-remove {
  display: block;
  margin: 8px auto 0;
  border: 0;
  background: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-light, #9C9080);
  cursor: pointer;
}

.hb-avatar-remove:hover { color: #A6371F; }

/* ─── headline and description ─── */

.hb-profile-headline {
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sunset, #E8622A);
  text-align: center;
  margin: 2px 0 0;
}

.hb-profile-bio {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-mid, #5A5248);
  text-align: center;
  margin: 12px 0 0;
  max-width: 34ch;
  margin-left: auto;
  margin-right: auto;
}

.hb-profile-bio-empty {
  color: var(--text-light, #9C9080);
  font-style: italic;
}

.hb-sub-field textarea#edit-bio { min-height: 84px; }

/* ─── the photo in the navigation bar ─── */

.hb-nav-avatar.has-photo {
  padding: 0;
  overflow: hidden;
  background: var(--cream, #FDF6EC);
  font-size: 0;
}

.hb-nav-avatar.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ─── /submit-evidence ───────────────────────────────────────────────────
   A page rather than a box: Circle 6 asks for a story, a link, a member list
   and a file, and none of that fits in a modal on a phone. */

.hb-page {
  min-height: 100vh;
  background: var(--warm-white, #FEFAF4);
  padding: 104px 20px 120px;
}

.hb-page-inner { max-width: 720px; margin: 0 auto; }

.hb-page-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light, #9C9080);
  text-decoration: none;
  margin-bottom: 22px;
}

.hb-page-back:hover { color: var(--sunset, #E8622A); }
.hb-page-back svg { width: 15px; height: 15px; }

.hb-page-id {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 24px;
  margin-bottom: 26px;
  border-bottom: 1px solid rgba(22, 33, 62, 0.08);
}

.hb-page-medal {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--cream, #FDF6EC);
  border: 1.5px solid rgba(232, 98, 42, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  color: var(--sunset, #E8622A);
}

.hb-page-medal img { width: 100%; height: 100%; object-fit: contain; }

.hb-page-eyebrow {
  font-family: 'DM Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--sunset, #E8622A);
}

.hb-page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 27px;
  font-weight: 600;
  color: var(--ocean, #16213E);
  margin: 5px 0 0;
  line-height: 1.15;
}

.hb-page-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  color: var(--text-mid, #5A5248);
  margin: 3px 0 0;
}

.hb-page-body { display: flex; flex-direction: column; gap: 22px; }

/* The footer follows you down a long form, so Send is never a scroll away. */
.hb-page-foot {
  position: sticky;
  bottom: 0;
  margin-top: 30px;
  padding: 16px 20px;
  background: rgba(254, 250, 244, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(22, 33, 62, 0.08);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hb-page-foot .hb-sub-reward { flex: 1 1 220px; }

.hb-page-skeleton {
  height: 58px;
  border-radius: 12px;
  background: linear-gradient(90deg, #F5F1E9 25%, #FBF8F2 50%, #F5F1E9 75%);
  background-size: 400% 100%;
  animation: hb-shimmer 1.4s ease-in-out infinite;
}

.hb-page-skeleton.short { width: 55%; }

@keyframes hb-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hb-page-skeleton { animation: none; }
}

.hb-page-problem { text-align: center; padding: 40px 20px; }

.hb-page-problem h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 21px;
  color: var(--ocean, #16213E);
  margin: 0 0 8px;
}

.hb-page-problem p {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text-mid, #5A5248);
  margin: 0 0 20px;
}

@media (max-width: 600px) {
  .hb-page { padding: 88px 16px 100px; }
  .hb-page-title { font-size: 23px; }
  .hb-page-medal { width: 52px; height: 52px; }
  .hb-page-foot { margin-left: -16px; margin-right: -16px; }
  .hb-page-foot .hb-btn-primary,
  .hb-page-foot .hb-btn-secondary { flex: 1; text-align: center; }
}
