/* ── Layout: nav bar (site-wide, fixed) → title → description → one big
   box → buttons → site footer below. Page scrolls normally like every
   other public page; padding-top clears the fixed .dl-nav. ── */
.dtf-fit.dtf-scope {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 1600px; margin: 0 auto;
  padding: 90px 4vw 60px;
}

/* ── Hero: centered title + one description line, like the reference ── */
.dtf-hero { text-align: center; flex-shrink: 0; }
.dtf-hero h1 {
  font-size: 1.5rem !important; font-weight: 800 !important;
  color: var(--brand, #4f46e5) !important;
  margin: 0 0 4px !important;
}
#dtfScope .dtf-hero p {
  font-size: .85rem !important; color: var(--txt-2, #64748b) !important;
  margin: 0 !important;
}

/* Card blends fully into the page background instead of sitting as a
   stark separate box — only the dashed border below is meant to stand
   out as the highlighted element. */
#dtfScope .dtf-card {
  max-width: 100% !important; width: 100%;
  padding: 24px 32px !important;
  background: var(--page-bg, #f8fafc) !important;
  border: 1px solid var(--border, #e2e8f0) !important;
  box-shadow: none !important;
  margin: 0 auto !important;
}
.dtf-upload-view { display: flex; flex-direction: column; }

/* The dropzone is a big, generously-sized open canvas — a fixed minimum
   height (not a flex-fill chain, which broke on shorter pages) so the
   layout never overlaps or collapses regardless of viewport size. */
.dtf-upload-section { display: flex; min-height: 320px; }
.dtf-scope .file-input-label {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  padding: 26px 20px;
  border: 2px dashed var(--brand, #3b82f6);
  border-radius: 14px;
  cursor: pointer;
  text-align: center;
  color: var(--txt, #0f172a);
  background: transparent;
  transition: border-color .2s ease, background .2s ease;
}
.dtf-scope .file-input-label:hover,
.dtf-scope .file-input-label.dtf-dragover {
  border-color: var(--brand-dark, #2563eb);
  background: rgba(59,130,246,.05);
}
.dtf-scope .file-input-label i {
  color: var(--brand, #3b82f6);
  font-size: 2.2rem;
}
.dtf-drop-title { font-weight: 700; margin-top: 10px; font-size: .95rem; color: var(--txt, #0f172a); }
.dtf-drop-sub { font-size: .8rem; opacity: .65; margin-top: 4px; color: var(--txt-2, #64748b); }

.dtf-form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 20px;
}
@media (max-width: 600px) {
  .dtf-form-row { grid-template-columns: 1fr; }
}

#dtfScope #dtfUploadBtn {
  background: linear-gradient(135deg, var(--brand, #4f46e5), var(--brand-dark, #4338ca));
  border: none;
  padding: 13px 26px;
  font-weight: 700;
  font-size: .95rem;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(79,70,229,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
#dtfScope #dtfUploadBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(79,70,229,.45);
}
#dtfScope #dtfUploadBtn:active { transform: translateY(0); }
#dtfScope #dtfUploadBtn i { margin-right: 4px; }

/* Guidance when Share is clicked without a valid email — highlight the
   field, shake it, and show an inline hint instead of doing nothing. */
.dtf-field-hint {
  font-size: .76rem; color: var(--brand, #4f46e5);
  margin-top: 4px; max-height: 0; overflow: hidden;
  transition: max-height .2s ease;
}
.dtf-field-hint.dtf-hint-show { max-height: 40px; }
.dtf-scope input.dtf-field-invalid {
  border-color: var(--brand, #4f46e5) !important;
  box-shadow: 0 0 0 3px rgba(79,70,229,.15) !important;
}
.dtf-shake { animation: dtfShake .4s ease; }
@keyframes dtfShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(7px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .dtf-shake { animation: none; }
}

.dtf-file-row {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--page-bg, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
}
.dtf-file-row i.fa-file { font-size: 1.4rem; color: var(--brand, #4f46e5); }
.dtf-file-name { font-weight: 700; font-size: .88rem; color: var(--txt, #0f172a); word-break: break-all; }
.dtf-file-size { font-size: .76rem; color: var(--txt-2, #64748b); }
.dtf-remove {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--red, #ef4444); border: none; border-radius: 50%;
  color: #fff; font-size: .85rem; cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.dtf-remove:hover { background: #dc2626; transform: scale(1.08); }
#dtfScope .req { color: var(--brand, #3b82f6); }

/* Hidden — the ring above plus the Uploading/Encrypting/Creating-link step
   icons already show progress; the native <progress> bar can't be themed
   consistently across browsers and just looked like a stray flat green
   stripe, so it's redundant rather than fixed. */
.dtf-scope progress { display: none; }
.dtf-progress-text { font-size: .85rem; margin-top: 10px; color: var(--txt, #0f172a); font-weight: 600; text-align: center; }
.dtf-progress-meta { font-size: .76rem; margin-top: 4px; color: var(--txt-2, #64748b); text-align: center; }

/* ── Real-time processing screen: replaces the form while the file is
   uploading + being encrypted server-side, so the user always sees what
   stage it's at instead of a frozen screen. ── */
.dtf-processing { padding: 10px 0 4px; }

/* Big animated ring with a live counting percentage in the center. */
.dtf-ring-wrap {
  position: relative;
  width: 140px; height: 140px;
  margin: 0 auto 18px;
}
.dtf-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.dtf-ring-track {
  fill: none; stroke: var(--border, #e2e8f0); stroke-width: 8;
}
.dtf-ring-fill {
  fill: none; stroke: var(--brand, #4f46e5); stroke-width: 8;
  stroke-linecap: round;
  transition: stroke .2s ease;
  filter: drop-shadow(0 0 6px rgba(79,70,229,.45));
}
.dtf-ring-center {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--txt, #0f172a);
}
.dtf-ring-count { font-size: 2.1rem; line-height: 1; }
.dtf-ring-percent { font-size: 1.1rem; opacity: .7; margin-left: 2px; }
/* Indeterminate state (server-side encrypting/linking, no real progress
   number to show): keep it reading as a full ring — a short rotating dash
   here would look like a spinning line instead of a circle — and just
   pulse it gently to signal "still working". */
.dtf-ring-wrap.dtf-ring-spin .dtf-ring-fill {
  stroke-dasharray: none !important;
  animation: dtfRingPulse 1.3s ease-in-out infinite;
}
@keyframes dtfRingPulse {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .dtf-ring-wrap.dtf-ring-spin .dtf-ring-fill { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dtf-ring-wrap.dtf-ring-spin .dtf-ring { animation: none; }
}

.dtf-process-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-bottom: 22px;
}
.dtf-process-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 700;
  color: var(--txt-2, #64748b);
  opacity: .55;
  transition: opacity .2s ease;
}
.dtf-process-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface, #fff);
  border: 2px solid var(--border, #e2e8f0);
  color: var(--txt-2, #64748b);
  font-size: .9rem;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.dtf-process-line { width: 36px; height: 2px; background: var(--border, #e2e8f0); }
.dtf-process-step.dtf-step-active { opacity: 1; }
.dtf-process-step.dtf-step-active .dtf-process-icon {
  border-color: var(--brand, #4f46e5);
  color: var(--brand, #4f46e5);
  box-shadow: 0 0 0 4px rgba(79,70,229,.12);
  animation: dtfPulseStep 1.3s ease-in-out infinite;
}
.dtf-process-step.dtf-step-done { opacity: 1; }
.dtf-process-step.dtf-step-done .dtf-process-icon {
  border-color: #16a34a; color: #fff; background: #16a34a;
}
@keyframes dtfPulseStep {
  0%, 100% { box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
  50%      { box-shadow: 0 0 0 8px rgba(79,70,229,.04); }
}
@media (prefers-reduced-motion: reduce) {
  .dtf-process-step.dtf-step-active .dtf-process-icon { animation: none; }
}

.dtf-error {
  margin-top: 12px; padding: 10px 14px;
  border-radius: 10px;
  background: var(--page-bg, #f8fafc);
  border: 1px dashed var(--brand, #3b82f6);
  color: var(--txt, #0f172a); font-size: .85rem;
}

.dtf-result-icon { text-align: center; font-size: 2.6rem; color: #16a34a; margin-bottom: 6px; }

.dtf-link-row {
  display: flex; gap: 8px; margin: 16px 0;
}
.dtf-link-row input {
  flex: 1; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--page-bg, #f8fafc);
  color: var(--txt, #0f172a);
  font-size: .85rem;
}

.dtf-countdown {
  font-size: .85rem; font-weight: 700;
  color: var(--brand, #4f46e5);
}

.dtf-result-extra {
  display: flex; align-items: center; gap: 16px;
  margin: 14px 0;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
}
.dtf-qr { border-radius: 8px; flex-shrink: 0; background: #fff; padding: 4px; display: block; }
.dtf-qr-btn {
  position: relative; flex-shrink: 0;
  border: none; background: none; padding: 0; cursor: pointer;
  border-radius: 8px; overflow: hidden;
  transition: transform .15s ease;
}
.dtf-qr-btn:hover { transform: scale(1.04); }
.dtf-qr-zoom-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15,23,42,.55); color: #fff; font-size: 1.1rem;
  opacity: 0; transition: opacity .15s ease;
}
.dtf-qr-btn:hover .dtf-qr-zoom-hint, .dtf-qr-btn:focus-visible .dtf-qr-zoom-hint { opacity: 1; }
.dtf-result-extra-text p {
  font-size: .78rem !important; margin: 6px 0 0 !important;
  color: var(--txt-2, #64748b) !important;
}
@media (max-width: 480px) {
  .dtf-result-extra { flex-direction: column; text-align: center; }
}

/* Click-to-zoom QR lightbox */
.dtf-qr-modal {
  position: fixed; inset: 0; z-index: 100001;
  display: none; align-items: center; justify-content: center;
}
.dtf-qr-modal.dtf-qr-modal-open { display: flex; }
.dtf-qr-modal-backdrop {
  position: absolute; inset: 0; background: rgba(15,23,42,.7);
  animation: dtfFadeIn .15s ease;
}
.dtf-qr-modal-box {
  position: relative; z-index: 1;
  background: #fff; padding: 28px;
  border-radius: 18px;
  text-align: center;
  animation: dtfPopIn .2s ease;
  box-shadow: 0 30px 60px rgba(0,0,0,.4);
}
.dtf-qr-modal-box img { border-radius: 10px; display: block; margin: 0 auto; }
.dtf-qr-modal-box p { color: #1f2937 !important; font-size: .85rem !important; margin-top: 14px !important; }
.dtf-qr-modal-x {
  position: absolute; top: -14px; right: -14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand, #4f46e5); color: #fff; border: none;
  font-size: 1.3rem; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,.3);
}
@keyframes dtfFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dtfPopIn {
  from { opacity: 0; transform: scale(.85); }
  to   { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .dtf-qr-modal-backdrop, .dtf-qr-modal-box { animation: none; }
}

/* ── Download landing page (views/transfer_download.php) ────────── */
.dtf-dl-badge {
  width: 64px; height: 64px; margin: 0 auto 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand, #4f46e5), var(--brand-dark, #4338ca));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.7rem;
  box-shadow: 0 12px 30px rgba(79,70,229,.4);
  position: relative; z-index: 1;
  animation: dtfBadgeFloat 3.2s ease-in-out infinite;
}
@keyframes dtfBadgeFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-8px) rotate(-4deg); }
}
.dtf-dl-title span {
  background: linear-gradient(135deg, var(--brand, #4f46e5), #ec4899);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (prefers-reduced-motion: reduce) {
  .dtf-dl-badge { animation: none; }
}

.dtf-dl-card {
  max-width: 440px; margin: 28px auto 0;
  padding: 32px 28px;
  border-radius: 18px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: var(--sh4, 0 10px 30px rgba(0,0,0,.08));
  position: relative; z-index: 1;
}
.dtf-dl-icon {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand, #2563eb), var(--brand-dark, #1d4ed8));
  box-shadow: 0 8px 20px rgba(37,99,235,.3);
}
.dtf-dl-name { font-weight: 800; font-size: 1.05rem; word-break: break-all; color: var(--txt, #0f172a); }
.dtf-dl-size { font-size: .82rem; color: var(--txt-2, #64748b); margin-top: 4px; }
.dtf-dl-sender {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px; font-size: .8rem; font-weight: 600;
  color: var(--txt-2, #64748b);
}
.dtf-dl-error {
  margin-top: 14px; padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface, #fff);
  border: 1px dashed var(--brand, #3b82f6);
  color: var(--txt, #0f172a); font-size: .82rem;
}
.dtf-dl-note { font-size: .76rem; color: var(--txt-2, #64748b); margin-top: 16px; }
.dtf-dl-quota {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px; padding: 5px 12px;
  border-radius: 999px;
  background: rgba(37,99,235,.1);
  color: var(--brand, #2563eb);
  font-size: .76rem; font-weight: 700;
}
.dtf-dl-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 22px 0 14px; color: var(--txt-2, #64748b); font-size: .76rem;
}
.dtf-dl-divider::before, .dtf-dl-divider::after { content: ''; flex: 1; height: 1px; background: var(--border, #e2e8f0); }
.dtf-dl-send-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .85rem; font-weight: 700;
  color: var(--brand, #2563eb);
  text-decoration: none;
}
.dtf-dl-send-link:hover { text-decoration: underline; }
