/* Public transfer pages — GitHub-style dark theme in DX Mail colors
   (navy / red / white). These pages run under STRICT CSP
   (style-src 'self'; script-src 'self'): every visual effect lives in this
   file — no inline styles anywhere, no external fonts, no CDN. */

:root {
  --ft-bg: #0a1022;
  --ft-surface: #101a30;
  --ft-card: #142039;
  --ft-border: #243352;
  --ft-border-strong: #33476e;
  --ft-text: #e6edf3;
  --ft-muted: #8da2c0;
  --ft-navy: #1f4fa0;
  --ft-navy-bright: #3b6fd4;
  --ft-navy-glow: rgba(59, 111, 212, 0.35);
  --ft-red: #e5484d;
  --ft-red-dim: rgba(229, 72, 77, 0.15);
  --ft-green: #3fb950;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ft-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--ft-bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(31, 79, 160, 0.35), transparent),
    radial-gradient(ellipse 60% 40% at 90% 110%, rgba(229, 72, 77, 0.12), transparent);
  background-attachment: fixed;
}

@keyframes ft-card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ft-shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}

@keyframes ft-check-pop {
  0%   { transform: scale(0) rotate(-20deg); }
  70%  { transform: scale(1.2) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

.card {
  position: relative;
  background: var(--ft-card);
  border: 1px solid var(--ft-border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  padding: 34px 32px 28px;
  max-width: 470px;
  width: calc(100% - 32px);
  margin: 16px;
  animation: ft-card-in 0.4s ease both;
}

/* DX brand strip across the card top: navy fading into red */
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(90deg, var(--ft-navy) 0%, var(--ft-navy-bright) 60%, var(--ft-red) 100%);
}

h1 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin: 4px 0 14px;
}

p { line-height: 1.55; font-size: 0.92rem; }

.muted {
  color: var(--ft-muted);
  font-size: 0.82rem;
}

.error {
  color: #ffb3b5;
  background: var(--ft-red-dim);
  border: 1px solid rgba(229, 72, 77, 0.55);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
}
.error strong { color: #ff8589; }

label {
  display: block;
  font-weight: 600;
  color: var(--ft-text);
  margin-bottom: 6px;
}

input[type="text"],
input[type="file"] {
  display: block;
  width: 100%;
  padding: 11px 12px;
  margin-bottom: 16px;
  background: var(--ft-surface);
  color: var(--ft-text);
  border: 1px solid var(--ft-border-strong);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="file"]:focus {
  outline: none;
  border-color: var(--ft-navy-bright);
  box-shadow: 0 0 0 3px var(--ft-navy-glow);
}

input#pin {
  letter-spacing: 10px;
  font-size: 1.6rem;
  text-align: center;
  color: #fff;
  font-weight: 600;
}
input#pin::placeholder { color: #3d4f74; letter-spacing: 10px; }

input[type="file"] {
  padding: 18px 12px;
  border-style: dashed;
  cursor: pointer;
}
input[type="file"]:hover { border-color: var(--ft-navy-bright); }
input[type="file"]::file-selector-button {
  background: var(--ft-navy);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  margin-right: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}
input[type="file"]::file-selector-button:hover { background: var(--ft-navy-bright); }

button,
.button {
  display: inline-block;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--ft-navy-bright), var(--ft-navy));
  color: #fff;
  border: 1px solid var(--ft-navy);
  border-radius: 8px;
  padding: 11px 26px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

button::after,
.button::after { /* hover sheen sweep */
  content: '';
  position: absolute; top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  transform: skewX(-20deg);
  transition: left 0.45s ease;
}

button:hover,
.button:hover {
  box-shadow: 0 0 0 3px var(--ft-navy-glow);
  transform: translateY(-1px);
  color: #fff;
}
button:hover::after,
.button:hover::after { left: 130%; }
button:active, .button:active { transform: translateY(0); }

button:disabled {
  background: #22335a;
  border-color: #22335a;
  color: #6d80a5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
button:disabled::after { display: none; }

/* ---------- upload progress ---------- */
#progress-wrap {
  margin-top: 18px;
  background: var(--ft-surface);
  border: 1px solid var(--ft-border);
  border-radius: 999px;
  overflow: hidden;
}

#progress-bar {
  height: 12px;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg,
    var(--ft-navy) 0%, var(--ft-navy-bright) 25%, #6b95e8 50%,
    var(--ft-navy-bright) 75%, var(--ft-navy) 100%);
  background-size: 200% 100%;
  animation: ft-shimmer 1.6s linear infinite;
  transition: width 0.25s ease;
}

#progress-text {
  margin: 8px 0 0;
  text-align: center;
  color: var(--ft-muted);
}

/* browser->server leg complete; server is validating + moving the file to
   storage (class toggled by transfer_upload.js) */
#progress-wrap.finishing #progress-bar {
  width: 100%;
  background: repeating-linear-gradient(45deg,
    var(--ft-navy-bright) 0 12px, var(--ft-navy) 12px 24px);
  background-size: 34px 100%;
  animation: ft-stripe 0.9s linear infinite;
}

@keyframes ft-stripe {
  from { background-position: 0 0; }
  to   { background-position: 34px 0; }
}

/* uploading state (class toggled by transfer_upload.js) */
form.uploading input[type="file"] { opacity: 0.55; }

/* ---------- success check (done page) ---------- */
.success-check {
  width: 58px; height: 58px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(63, 185, 80, 0.15);
  border: 2px solid var(--ft-green);
  color: var(--ft-green);
  font-size: 1.6rem;
  line-height: 54px;
  text-align: center;
  animation: ft-check-pop 0.45s ease 0.15s both;
}

/* ---------- file info row (download page) ---------- */
.file-box {
  background: var(--ft-surface);
  border: 1px solid var(--ft-border-strong);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 12px 0 16px;
  font-size: 0.95rem;
  color: #fff;
  word-break: break-all;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
