/* File Transfer — tool-specific styles. Tokens and the shared chrome come from base.css. */

/* Setup notice (only visible until the Firebase web config is filled in). */
.ft-setup {
  margin: 0 0 18px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: rgba(255,107,138,.08); border: 1px solid rgba(255,107,138,.35);
  color: var(--text); font-size: .92rem; line-height: 1.6;
}
.ft-setup code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em;
  background: var(--card-2); padding: 1px 6px; border-radius: 6px;
}

/* ── file lists (outgoing, incoming and received) ───────────────────────── */
.ft-list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.ft-file {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--bg-soft); border: 1px solid var(--line);
}
.ft-file-n {
  flex: 1; min-width: 0; font-weight: 500; font-size: .93rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ft-file-s {
  color: var(--muted-2); font-size: .84rem; font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.ft-file-x {
  flex-shrink: 0; width: 26px; height: 26px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted-2);
  cursor: pointer; font-size: .8rem; transition: background .18s var(--ease-out), color .18s var(--ease-out);
}
.ft-file-x:hover { background: var(--card-2); color: var(--danger); }
.ft-file .ft-dl { flex-shrink: 0; padding: 7px 15px; min-height: 34px; font-size: .85rem; }

.ft-sum {
  margin: 12px 0 0; color: var(--muted); font-size: .88rem;
  font-variant-numeric: tabular-nums;
}
.ft-label {
  margin: 0 0 10px; font-size: .82rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted-2);
}
.ft-hint { margin: 12px 0 0; color: var(--muted-2); font-size: .87rem; }

.ft-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.ft-actions-left { justify-content: flex-start; }

/* ── pairing view (QR + code) ───────────────────────────────────────────── */
.ft-pair {
  display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: start;
  padding: 24px; border-radius: var(--radius);
  background: var(--bg-soft); border: 1px solid var(--line);
}
.ft-pair-qr { text-align: center; }
/* The QR renders on white deliberately: inverted codes are unreliable on many
   phone cameras, so the card carries the light background rather than the page. */
.ft-qr {
  width: 208px; height: 208px; border-radius: 14px; background: #fff;
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.6);
}
.ft-qr canvas, .ft-qr svg { display: block; max-width: 100%; height: auto; }
.ft-qr-hint { margin: 12px 0 0; font-size: .82rem; color: var(--muted-2); }

.ft-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(2rem, 7vw, 2.9rem); font-weight: 700; letter-spacing: .16em;
  color: var(--text); background: var(--card-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 18px; text-align: center;
  word-break: break-all;
}
.ft-linkbox {
  width: 100%; margin-top: 14px; padding: 10px 13px; font-size: .82rem;
  color: var(--muted); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ft-expiry {
  margin: 16px 0 0; font-size: .9rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── receive form ───────────────────────────────────────────────────────── */
.ft-recv { max-width: 480px; margin: 8px auto 0; text-align: center; }
.ft-recv .ft-label { text-align: center; }
.ft-recv-row { display: flex; gap: 12px; align-items: stretch; }
.ft-codein {
  flex: 1; min-width: 0; padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.5rem; font-weight: 700; letter-spacing: .22em; text-align: center;
  text-transform: uppercase;
  color: var(--text); background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius-sm); transition: box-shadow .2s var(--ease-out), border-color .2s var(--ease-out);
}
.ft-codein::placeholder { color: var(--muted-2); letter-spacing: .22em; }
.ft-codein:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.ft-recv-row .btn { flex-shrink: 0; }

.ft-offer, .ft-result {
  margin-top: 8px; padding: 22px; border-radius: var(--radius);
  background: var(--bg-soft); border: 1px solid var(--line);
}

/* ── safety code (DTLS fingerprint check, like a Signal safety number) ──── */
.ft-safety {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 16px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--card-2); border: 1px solid var(--line);
}
.ft-safety-label {
  font-size: .72rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted-2);
}
.ft-safety-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.1rem; font-weight: 700; letter-spacing: .16em; color: var(--accent-2);
}
.ft-safety-hint { font-size: .8rem; color: var(--muted-2); }

/* ── progress ───────────────────────────────────────────────────────────── */
#ftProgress { margin-top: 22px; }
.ft-progmeta {
  margin: 10px 0 0; font-size: .87rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .ft-pair { grid-template-columns: 1fr; justify-items: center; gap: 22px; padding: 20px; }
  .ft-pair-code { width: 100%; }
  .ft-pair-code .ft-label { text-align: center; }
  .ft-actions-left { justify-content: center; }
}
@media (max-width: 460px) {
  .ft-recv-row { flex-direction: column; }
  .ft-qr { width: 180px; height: 180px; }
}
