/* ==========================================================================
   send.css — Send a file to a home: the steps inside the home page's
   lookup card (index.html, #sendPanel). Loads after landing.css.
   ========================================================================== */

/* Steps show and hide with the hidden attribute; their own display rules
   must never bring them back. */
main [hidden] { display: none !important; }
.hs-send { margin-top: 6px; }

.send-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Hero: the photo under a light veil that fades into the page ── */
.send-stage {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 96px 0 112px; color: var(--brown);
}
.send-bg { position: absolute; inset: 0; z-index: -1; background: var(--surface); }
.send-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; display: block; }
.send-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(70% 60% at 50% 42%, rgba(251,251,248,0.92) 0%, rgba(251,251,248,0.80) 60%, rgba(251,251,248,0.70) 100%),
    linear-gradient(180deg, rgba(251,251,248,0) 60%, var(--bg) 100%);
}
.send-inner { display: flex; flex-direction: column; align-items: center; }
.send-head { max-width: 720px; text-align: center; }

.send-kicker {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px;
  font-size: 14px; font-weight: 500; color: var(--accent);
}
.send-kicker i { font-size: 16px; }
.send-title {
  font-family: var(--serif); font-weight: 600; letter-spacing: -0.025em;
  font-size: clamp(36px, 5.4vw, 62px); line-height: 1.04;
  color: var(--brown); margin: 0; text-wrap: balance;
}
.send-title em { font-style: normal; color: var(--accent); }
.send-lede {
  margin: 20px auto 0; max-width: 52ch; font-size: 18.5px; line-height: 1.55;
  color: var(--brown-3); text-wrap: pretty;
}

/* The search sits on the page; the card only gets a surface once a home is
   chosen and the steps need one. */
.send-card { width: 100%; max-width: 640px; margin-top: 36px; color: var(--brown); }
.send-card:has(#homeChip:not([hidden])) {
  padding: 26px 28px 22px; border-radius: 22px;
  background: rgba(255,255,255,0.86); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 24px 60px -36px rgba(36,30,22,0.35);
}
.send-card .send-home { margin-top: 0; }
.send-card .send-step, .send-card .send-status, .send-card .send-mine-wrap { max-width: none; }
.send-card .send-mine-wrap { margin-top: 18px; padding-top: 4px; border-top: 1px solid var(--line); }

/* ── Three points, under the hero ───────────────────────────────────── */
.send-below { padding: 56px 0 88px; }
.send-points {
  list-style: none; margin: 0 auto; padding: 0; max-width: 980px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
}
.send-points li { display: flex; align-items: flex-start; gap: 14px; }
.send-points li > i {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--line); color: var(--accent); font-size: 21px;
}
.send-points span { display: flex; flex-direction: column; gap: 3px; font-size: 14.5px; color: var(--brown-4); padding-top: 2px; }
.send-points b { font-size: 15.5px; font-weight: 600; color: var(--brown); }

/* ── Search ─────────────────────────────────────────────────────────── */
.send-search { margin: 0; }
.send-search .addr-wrap { position: relative; }
.send-box {
  display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 0 7px 0 22px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 18px 44px -24px rgba(36,30,22,0.40), 0 1px 2px rgba(36,30,22,0.06);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.send-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(20,58,112,0.10); }
.send-box > i { font-size: 21px; color: var(--brown-4); flex: 0 0 auto; }
.send-input {
  flex: 1 1 auto; min-width: 0; height: 58px;
  border: 0; background: none; outline: none;
  font-family: var(--sans); font-size: 17px; color: var(--brown);
  -webkit-appearance: none; appearance: none; border-radius: 0;
}
.send-input::placeholder { color: var(--brown-4); }
.send-input::-webkit-search-cancel-button { display: none; }
.send-search .addr-list { text-align: left; border-radius: 16px; }
.addr-opt { min-height: 48px; }
.addr-opt[aria-selected="true"] { background: var(--surface-2); }

.send-box .send-btn { flex: 0 0 auto; min-height: 50px; padding: 0 24px; border-radius: 999px; }
.send-btn { min-height: 48px; padding: 12px 28px; font-size: 15.5px; font-weight: 600; border-radius: 12px; }
.send-btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.send-btn[aria-busy="true"] { opacity: .75; cursor: progress; }

.send-unit {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 0 0; max-width: 340px;
}
.send-unit label { font-size: 14px; color: var(--brown-3); white-space: nowrap; }


/* ── Shared fields / small links ────────────────────────────────────── */
.send-field {
  width: 100%; min-height: 48px; padding: 0 16px;
  font-family: var(--sans); font-size: 16px; color: var(--brown);
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 12px;
  outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.send-field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(20,58,112,0.10); }
.send-field--code {
  font-family: var(--mono); font-size: 24px; letter-spacing: .4em; text-align: center;
  max-width: 260px; display: block;
}
.send-label { display: block; font-size: 14px; font-weight: 600; color: var(--brown-2); margin: 0 0 8px; text-align: left; }

.send-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--accent);
  background: none; border: 0; cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.send-link:hover { color: var(--accent-soft); }
.send-muted { font-size: 13.5px; color: var(--brown-4); margin: 10px 0 0; }

/* ── Home chip ──────────────────────────────────────────────────────── */
.send-home {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
  margin: 24px 0 0; padding: 6px 8px 6px 16px;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 15.5px; font-weight: 600; color: var(--brown);
}
.send-home > i { font-size: 20px; color: var(--accent); flex: 0 0 auto; }
.send-home-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Steps ──────────────────────────────────────────────────────────── */
.send-step { margin: 26px 0 0; max-width: 520px; }
.send-step-title { font-size: 20px; font-weight: 600; margin: 0 0 16px; outline: none; }
.send-step form { display: grid; gap: 14px; }
.send-step .send-btn { width: 100%; }
.send-row-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }

/* Drop zone */
.send-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 190px; padding: 28px 20px;
  background: var(--bg); border: 2px dashed var(--line-strong); border-radius: 18px;
  cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.send-drop:hover, .send-drop.is-over { border-color: var(--accent); background: rgba(20,58,112,0.04); }
.send-file-input:focus-visible + .send-drop { outline: 2px solid var(--accent); outline-offset: 3px; }
.send-drop > i { font-size: 34px; color: var(--accent); }
.send-drop-main { font-size: 16.5px; font-weight: 600; color: var(--brown); }
.send-drop-main b { color: var(--accent); }
.send-drop-hint { font-size: 13px; color: var(--brown-4); }
.send-drop .on-touch { display: none; }
@media (hover: none), (max-width: 600px) {
  .send-drop .on-desk { display: none; }
  .send-drop .on-touch { display: inline; }
}

/* Camera buttons, under the drop zone */
.send-cam { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.send-cam[hidden], .send-drop[hidden] { display: none; }
.send-cam-btn {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 14px;
  font: inherit; color: var(--brown); text-align: left; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.send-cam-btn:hover { border-color: var(--accent); background: rgba(20,58,112,0.04); }
.send-cam-btn > i { flex: 0 0 auto; font-size: 26px; color: var(--accent); }
.send-cam-btn span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.send-cam-btn b { font-size: 15.5px; font-weight: 600; }
.send-cam-btn small { font-size: 12.5px; color: var(--brown-4); }
/* Phones: two square-ish tiles, icon over the words. */
@media (max-width: 600px) {
  .send-cam-btn { flex-direction: column; justify-content: center; gap: 6px; min-height: 104px; padding: 14px 8px; text-align: center; }
  .send-cam-btn > i { font-size: 30px; }
  .send-cam-btn span { align-items: center; }
  .send-pages { padding: 12px; }
}

/* Pages of a scan */
.send-pages { padding: 16px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 18px; }
.send-pages-head { margin: 0 0 10px; font-size: 14.5px; color: var(--brown-3); }
.send-pages-head b { color: var(--brown); font-weight: 600; }
.send-page-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.send-page {
  display: flex; align-items: center; gap: 12px; padding: 6px 4px 6px 6px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.send-page-thumb {
  flex: 0 0 auto; width: 52px; height: 52px; padding: 3px; border-radius: 8px; overflow: hidden;
  display: block; background: var(--surface-2);
}
.send-page-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .15s ease; }
.send-page-no { flex: 1 1 auto; font-size: 14.5px; font-weight: 600; }
.send-page-tools { display: flex; flex: 0 0 auto; }
.send-pages-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 10px; margin-top: 14px; }
.send-step .send-pages-actions .send-btn { width: 100%; padding-left: 10px; padding-right: 10px; }
.send-pages .send-row-links { justify-content: space-between; }

/* Webcam dialog */
.send-camera {
  width: min(760px, calc(100vw - 32px)); padding: 16px; border: 0; border-radius: 20px;
  background: #111; color: #f3efe3; box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}
.send-camera::backdrop { background: rgba(20,16,12,0.65); }
.send-camera-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.send-camera-title { margin: 0; font-size: 17px; font-weight: 600; color: inherit; }
.send-camera .send-file-x { color: #f3efe3; }
.send-camera .send-file-x:hover { background: rgba(255,255,255,0.12); color: #fff; }
.send-camera-view { position: relative; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.send-camera-view video { width: 100%; height: 100%; object-fit: contain; display: block; }
.send-camera-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.send-camera-flash.is-on { animation: send-flash .35s ease-out; }
@keyframes send-flash { from { opacity: .7; } to { opacity: 0; } }
.send-camera-hint { margin: 10px 0 0; font-size: 13.5px; color: rgba(243,239,227,0.75); text-align: center; }
.send-camera-actions { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 12px; }
.send-camera-count { font-size: 14.5px; font-weight: 600; }
.send-camera-actions .send-btn { justify-self: end; min-width: 120px; }
.send-shutter {
  width: 68px; height: 68px; border-radius: 50%; padding: 5px; cursor: pointer;
  background: none; border: 3px solid #f3efe3;
}
.send-shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #f3efe3; transition: transform .1s ease; }
.send-shutter:active span { transform: scale(.88); }

.send-as { margin: 0 0 14px; font-size: 14px; color: var(--brown-3); }
.send-as b { font-weight: 600; color: var(--brown); word-break: break-all; }

/* File list */
.send-files { list-style: none; margin: 14px 0 0; padding: 0; text-align: left; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.send-files:empty { display: none; }
.send-file {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 4px 4px 4px 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
}
.send-file > i { font-size: 20px; color: var(--brown-4); flex: 0 0 auto; }
.send-file-name { flex: 1 1 auto; min-width: 0; font-size: 14.5px; color: var(--brown); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send-file-size { flex: 0 0 auto; font-size: 12.5px; color: var(--brown-4); }
.send-file-x {
  flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 10px; cursor: pointer; color: var(--brown-4); font-size: 19px;
}
.send-file-x:hover { background: var(--surface-2); color: var(--danger); }
.send-files.is-done .send-file > i { color: var(--accent); }
.send-file-note { flex: 0 0 auto; font-size: 12.5px; color: var(--danger); padding-right: 10px; }
.send-step .send-files + .send-btn,
.send-step .send-files:empty + .send-btn { margin-top: 18px; }

/* Sending + done */
.send-spin {
  width: 40px; height: 40px; margin: 8px auto 14px; border-radius: 50%;
  border: 3px solid var(--line-strong); border-top-color: var(--accent);
  animation: send-spin .8s linear infinite;
}
@keyframes send-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .send-spin { animation-duration: 2.4s; } }
.send-done-check { font-size: 64px; line-height: 1; color: var(--accent); margin: 8px 0 10px; }
.send-done-check i { display: inline-block; }

/* Status (aria-live) */
.send-status { min-height: 22px; margin: 16px 0 0; max-width: 520px; font-size: 14.5px; color: var(--brown-3); }
.send-status:empty { margin-top: 0; }
.send-status.is-error { color: var(--danger); font-weight: 600; }
.send-status.is-ok { color: var(--accent); font-weight: 600; }

/* Your sent files */
.send-mine-wrap { margin: 28px 0 0; max-width: 520px; }
.send-mine-wrap > .send-link { padding-left: 0; }
.send-mine { list-style: none; margin: 8px 0 0; padding: 0; text-align: left; border-top: 1px solid var(--line); }
.send-mine li {
  display: flex; flex-wrap: wrap; gap: 2px 8px; padding: 12px 4px;
  border-bottom: 1px solid var(--line); font-size: 14px; color: var(--brown-3);
}
.send-mine li b { font-weight: 600; color: var(--brown); }
.send-mine .st-waiting { color: var(--warn); font-weight: 600; }
.send-mine .st-stored { color: var(--success); font-weight: 600; }
.send-mine .st-not_added { color: var(--brown-4); font-weight: 600; }
.send-mine-empty { font-size: 14px; color: var(--brown-4); padding: 12px 4px; }

/* ── Tablet ─────────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .send-stage { padding: 72px 0 80px; }
  .send-points { gap: 20px; }
}

/* ── Phone ──────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .send-stage .wrap, .send-below .wrap { padding: 0 16px; }
  .send-stage { padding: 44px 0 40px; }
  .send-kicker { margin-bottom: 14px; }
  .send-lede { font-size: 16.5px; margin-top: 14px; }
  .send-card { margin-top: 28px; }
  .send-card:has(#homeChip:not([hidden])) { padding: 20px 16px 16px; border-radius: 18px; }
  .send-bg img { object-position: 4% 40%; }
  .send-below { padding: 36px 0 56px; }
  .send-points { grid-template-columns: 1fr; gap: 18px; }
  .send-box { min-height: 58px; padding: 0 5px 0 16px; gap: 10px; }
  .send-input { height: 54px; font-size: 16px; }
  .send-box .send-btn { min-height: 48px; padding: 0 18px; }
  .send-unit { max-width: none; }
  .send-drop { min-height: 150px; }
  .send-home { display: flex; margin-top: 26px; }
  .send-home-label { flex: 1 1 auto; }
}
/* Small phones: the magnifier gives its room to the placeholder. */
@media (max-width: 420px) {
  .send-box > i { display: none; }
  .send-box { padding-left: 20px; }
}
