/* ===== Sapu Earth forms: upload page, admin, partner pages. Builds on styles.css ===== */
body.form-page { min-height: 100vh; }
.fp-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 16px 0; max-width: 760px; margin: 0 auto;
}
.logo-sm { font-size: 24px; text-decoration: none; display: inline-block; }
.fp-main { max-width: 760px; margin: 0 auto; padding: 22px 16px 60px; }
.fp-title { font-size: clamp(26px, 7vw, 40px); line-height: 1.05; }
.fp-title mark { background: linear-gradient(0deg, var(--tape) 0 42%, transparent 42%); color: var(--ink); padding: 0 6px; }
.fp-stats { margin: 4px 0 22px; }
.fp-foot { text-align: center; margin-top: 30px; }
.sub a { color: var(--hivis); }

.lang { display: flex; gap: 0; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); background: var(--paper); }
.lang button {
  font-family: var(--font-mono); font-weight: 700; font-size: 12px; letter-spacing: 1px;
  border: 0; background: transparent; color: var(--ink); padding: 8px 10px; cursor: pointer; min-height: 36px;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.who {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  background: var(--tape); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  padding: 10px 12px; margin: 14px 0 18px; overflow-wrap: anywhere;
}
.who.bad { background: #ffd9c7; }

.panel {
  background: var(--paper); border: 2px solid var(--ink); box-shadow: 5px 5px 0 rgba(28, 24, 19, .9);
  padding: 16px 14px 18px; margin: 0 0 20px;
}
.panel-title { font-family: var(--font-display); font-weight: 400; font-size: 17px; letter-spacing: .5px; margin-bottom: 4px; }
.hint { font-family: var(--font-mono); font-size: 12px; font-weight: 400; color: var(--dim); line-height: 1.45; }

.field { display: block; margin-top: 14px; }
.field > span, .field > legend {
  display: block; font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; margin-bottom: 6px;
}
.field .req { color: var(--hivis); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; align-items: end; }
@media (max-width: 360px) { .row2 { grid-template-columns: 1fr; } }

input[type="text"], input[type="number"], input[type="date"], input[type="url"], input[type="password"],
input[type="tel"], input[type="email"], select, textarea {
  width: 100%; font: 600 16px/1.3 var(--font-body); color: var(--ink);
  background: #fff; border: 2px solid var(--ink); border-radius: 0; padding: 10px 10px; min-height: 46px;
  -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 30px; }
textarea { min-height: 90px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid var(--hivis); outline-offset: 2px; }
.field.invalid input, .field.invalid select, .field.invalid textarea, .drop.invalid, .field.invalid .drop { border-color: var(--hivis); box-shadow: 0 0 0 2px var(--hivis); }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.35; margin-top: 12px; cursor: pointer; }
.check input { width: 24px; height: 24px; flex: 0 0 24px; accent-color: var(--hivis); margin-top: 1px; }
.check.invalid input { outline: 3px solid var(--hivis); outline-offset: 2px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; align-items: center; }
.b {
  font-family: var(--font-display); font-size: 14px; letter-spacing: .5px;
  color: var(--ink); background: var(--tape); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  padding: 11px 16px 10px; cursor: pointer; min-height: 46px; text-decoration: none; display: inline-block;
}
.b:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.b[disabled] { opacity: .55; cursor: default; }
.b-go { background: var(--hivis); color: #fff; width: 100%; font-size: 18px; padding: 15px 16px 14px; }
.b-ghost { background: var(--paper); }
.b-red { background: #ffd9c7; }
.b-ok { background: #c9f0d6; }
.b-sm { font-size: 12px; padding: 7px 10px 6px; min-height: 36px; box-shadow: 3px 3px 0 var(--ink); }

/* file pickers */
.drop {
  position: relative; display: grid; place-items: center; text-align: center; gap: 4px;
  border: 2px dashed var(--ink); background: repeating-linear-gradient(45deg, #f7f2e4 0 8px, #efe8d5 8px 16px);
  padding: 16px 10px; cursor: pointer; min-height: 70px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
}
.drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop.full { display: none; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 10px; }
.thumbs:empty { display: none; }
.thumb { position: relative; background: #e9e2cf; border: 2px solid var(--ink); aspect-ratio: 1; overflow: hidden; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .vlabel { position: absolute; top: 4px; left: 4px; background: var(--ink); color: var(--paper); font: 700 10px var(--font-mono); padding: 2px 5px; }
.thumb .rm {
  position: absolute; top: 3px; right: 3px; width: 30px; height: 30px; border: 2px solid var(--ink);
  background: var(--paper); font: 700 14px var(--font-mono); cursor: pointer; color: var(--ink);
}
.thumb .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: rgba(28, 24, 19, .4); }
.thumb .bar i { display: block; height: 100%; width: 0; background: var(--hivis); transition: width .2s; }
.thumb.done .bar i { background: #1a9a4a; }
.thumb.done::after { content: "✓"; position: absolute; bottom: 10px; right: 6px; font: 700 16px var(--font-mono); color: #fff; text-shadow: 0 0 3px #000; }
.thumb.failed { border-color: var(--hivis); }
.thumb.busy::before { content: "…"; position: absolute; inset: 0; display: grid; place-items: center; font: 700 22px var(--font-mono); }

.msg { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; margin-top: 8px; line-height: 1.4; }
.msg:empty { display: none; }
.msg.err { color: #b33a00; }
.msg.ok { color: #1a7a3a; }
.coords { font-family: var(--font-mono); font-size: 13px; margin-top: 8px; }

.progress-all { height: 14px; border: 2px solid var(--ink); background: var(--paper); margin-top: 14px; }
.progress-all i { display: block; height: 100%; width: 0; background: var(--hivis); transition: width .2s; }
.status-line { font-family: var(--font-mono); font-size: 13px; font-weight: 700; margin-top: 8px; min-height: 1.4em; }

.done-screen { text-align: center; padding: 26px 14px 30px; }
.done-screen .big { font-family: var(--font-display); font-size: 34px; color: #1a7a3a; }
.done-screen p { font-size: 17px; line-height: 1.45; margin: 12px auto 20px; max-width: 32em; }
.done-screen .ref { font-family: var(--font-mono); font-size: 13px; color: var(--dim); }

/* admin */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 18px; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.sub-card { background: var(--paper); border: 2px solid var(--ink); box-shadow: 5px 5px 0 rgba(28, 24, 19, .9); padding: 14px; margin-bottom: 22px; }
.sub-card h3 { font-family: var(--font-display); font-weight: 400; font-size: 18px; overflow-wrap: anywhere; }
.sub-meta { font-family: var(--font-mono); font-size: 12px; color: var(--dim); margin: 4px 0 10px; overflow-wrap: anywhere; }
.media-ba { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.media-ba h4, .media-v h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; margin: 4px 0; }
.media-ba img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; border: 2px solid var(--ink); margin-bottom: 6px; background: #e9e2cf; }
.media-v { margin-top: 8px; }
.media-v video { width: 100%; max-height: 420px; background: #000; display: block; margin-bottom: 6px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; font-family: var(--font-mono); font-size: 12.5px; margin: 10px 0; }
.kv dt { color: var(--dim); }
.kv dd { font-weight: 700; overflow-wrap: anywhere; white-space: pre-wrap; }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.edit-grid .wide { grid-column: 1 / -1; }
.caption { width: 100%; min-height: 96px; font: 400 14px/1.4 var(--font-mono); }
.dl-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dl-list a { font: 700 12px var(--font-mono); color: var(--hivis); }
.p-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; border-top: 2px dashed var(--rule); padding: 10px 0; }
.p-row:first-child { border-top: 0; }
.p-row .p-name { font-family: var(--font-display); font-size: 15px; }
.p-row small { display: block; font-family: var(--font-mono); font-size: 11.5px; color: var(--dim); font-weight: 400; overflow-wrap: anywhere; }
.secret { font-family: var(--font-mono); font-size: 13px; background: var(--tape); border: 2px solid var(--ink); padding: 10px; margin-top: 10px; overflow-wrap: anywhere; }
.inactive { opacity: .55; }

/* partner page list */
.p-list { list-style: none; }
.p-list li + li { border-top: 2px dashed var(--rule); }
.p-list a { display: flex; gap: 12px; align-items: center; padding: 10px 0; color: var(--ink); text-decoration: none; }
.p-list img, .p-list .noimg { width: 72px; height: 54px; object-fit: cover; flex: 0 0 72px; border: 2px solid var(--ink); background: #e9e2cf; }
.p-list .row-text { display: block; min-width: 0; }
.p-list b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 15px; overflow-wrap: anywhere; }
.p-list small { font-family: var(--font-mono); font-size: 11.5px; color: var(--dim); }

[hidden] { display: none !important; }

/* upload page: review fixes */
.echo { display: block; font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: #1a7a3a; margin-top: 4px; min-height: 0; }
.echo:empty { display: none; }
.fmsg { display: block; }
.field > .fmsg { text-transform: none; letter-spacing: 0; font-size: 12.5px; margin: 6px 0 0; }
.keep-open {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700; line-height: 1.4;
  background: var(--tape); border: 2px solid var(--ink); padding: 10px 12px; margin-top: 14px;
}
#formErr { margin: 0 0 10px; }
.page-box { margin-top: 18px; }
.page-box p { font-size: 15px; margin: 0 auto 6px; }
.page-box a { font-family: var(--font-mono); font-weight: 700; color: var(--hivis); overflow-wrap: anywhere; display: inline-block; margin-bottom: 4px; }
.mine-list { list-style: none; }
.mine-list li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 2px dashed var(--rule); }
.mine-list li:first-child { border-top: 0; }
.mine-list b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 15px; overflow-wrap: anywhere; }
.mine-list small { font-family: var(--font-mono); font-size: 11.5px; color: var(--dim); }
.mine-list li[data-status="approved"] small { color: #1a7a3a; font-weight: 700; }
.kv dd.private { background: #fff3c4; }

/* apply page */
.fp-lead { font-size: 17px; line-height: 1.45; margin: 14px 0 10px; max-width: 34em; }
.fp-note {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; line-height: 1.5;
  border-left: 6px solid var(--hivis); padding: 2px 0 2px 10px; margin: 0 0 22px; max-width: 46em;
}
.field .link-line { margin-top: 8px; }
.link-line input::placeholder { font-size: 14px; }
.check .req { color: var(--hivis); }
.fp-title + .panel, .fp-main > .done-screen { margin-top: 18px; }
.check a, .privacy a {
  color: var(--ink); overflow-wrap: anywhere;
  text-decoration-color: var(--hivis); text-decoration-thickness: 2px; text-underline-offset: 3px;
}
/* error boxes placed right after a label (apply page) */
.field + .fmsg { margin-top: 6px; }
/* WhatsApp echo when the number's country code is not the chosen country's */
.echo.warn { color: #b33a00; }
.echo .echo-hint { display: block; }
/* privacy notice under the consent checkbox */
.privacy { margin-top: 14px; background: #fff; border: 2px dashed var(--ink); }
.privacy summary {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; line-height: 1.4;
  padding: 11px 12px; min-height: 44px; cursor: pointer;
}
.privacy summary:focus-visible { outline: 3px solid var(--hivis); outline-offset: 2px; }
.privacy ul { list-style: none; padding: 0 12px 12px; }
.privacy li { font-size: 14px; line-height: 1.45; margin-top: 8px; overflow-wrap: anywhere; }
.privacy li b { font-family: var(--font-mono); font-size: 12px; letter-spacing: .5px; text-transform: uppercase; }
/* THANK YOU gets focus after sending (apply and upload pages) */
.done-screen .big:focus { outline: none; }
.done-screen .big:focus-visible { outline: 3px solid var(--hivis); outline-offset: 4px; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.btn-row.center { justify-content: center; }
.done-screen .follow { font-size: 15px; margin: 22px auto 4px; }
.who a { color: inherit; text-decoration: underline; }

/* upload page: save-your-link card (hazard tape on top) */
.panel.save-link {
  padding-top: 26px;
  background-image: repeating-linear-gradient(-45deg, var(--ink) 0 10px, var(--tape) 10px 20px);
  background-size: 100% 10px; background-repeat: no-repeat;
}
.save-link p { font-size: 15px; line-height: 1.45; margin: 8px 0 0; }
.save-link .save-tip {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700; line-height: 1.45;
  background: #fff; border: 2px dashed var(--ink); padding: 8px 10px; margin-top: 12px;
}
.save-link .btn-row { margin-top: 14px; }
.save-link .btn-row .b { flex: 1 1 auto; text-align: center; }
.save-again { text-align: center; margin-top: 26px; }
.text-btn {
  background: none; border: 0; color: var(--dim); cursor: pointer; min-height: 44px; padding: 10px 12px;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; text-decoration: underline;
}
