:root {
  color-scheme: light dark;
  --background: #f8fafc;
  --surface: #ffffff;
  --foreground: #0f172a;
  --muted-foreground: #526174;
  --muted: #f1f5fd;
  --border: #dbe5f5;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --on-primary: #ffffff;
  --accent: #d97706;
  --success: #15803d;
  --danger: #dc2626;
  --ring: #2563eb;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--foreground);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button, input { font: inherit; }
button, a, label { touch-action: manipulation; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  color: var(--on-primary);
  background: var(--primary);
  border-radius: 8px;
}
.skip-link:focus { top: 16px; }

.site-header {
  width: min(100% - 32px, 1120px);
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--foreground);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.brand svg { width: 28px; height: 28px; fill: none; stroke: var(--primary); stroke-width: 2.5; }
.privacy-note { color: var(--muted-foreground); font-size: 14px; }

.page-shell {
  width: min(100% - 32px, 680px);
  margin: auto;
  padding: 56px 0 72px;
}

.hero { margin-bottom: 40px; text-align: center; }
.eyebrow { margin: 0 0 12px; color: var(--primary); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(38px, 7vw, 64px); line-height: 1.04; letter-spacing: -.045em; }
.lead { max-width: 520px; margin: 20px auto 0; color: var(--muted-foreground); font-size: 18px; }

.transfer-card {
  padding: clamp(24px, 5vw, 40px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
}

h2 { margin: 0; font-size: 24px; line-height: 1.25; letter-spacing: -.02em; }
.card-copy { margin: 8px 0 24px; color: var(--muted-foreground); }

.drop-zone {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 2px dashed var(--border);
  border-radius: 16px;
  background: var(--muted);
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease;
}
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--primary); }
.drop-zone:focus-within { outline: 3px solid color-mix(in srgb, var(--ring) 35%, transparent); outline-offset: 3px; }
.drop-zone svg { width: 40px; height: 40px; margin-bottom: 16px; fill: none; stroke: var(--primary); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-title { color: var(--primary); font-weight: 700; }
.drop-hint { margin-top: 4px; color: var(--muted-foreground); font-size: 14px; }

.file-row { display: flex; align-items: center; gap: 16px; min-width: 0; }
.file-icon { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-radius: 12px; }
.file-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.file-details { min-width: 0; display: flex; flex-direction: column; }
.file-details strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-details small { color: var(--muted-foreground); }

.field-label { display: block; margin: 28px 0 8px; font-size: 14px; font-weight: 650; }
.copy-field { display: grid; grid-template-columns: 1fr 48px; gap: 8px; }
.copy-field input { min-width: 0; height: 48px; padding: 0 14px; color: var(--foreground); background: var(--muted); border: 1px solid var(--border); border-radius: 10px; }
.icon-button { width: 48px; height: 48px; display: grid; place-items: center; color: var(--on-primary); background: var(--primary); border: 0; border-radius: 10px; cursor: pointer; transition: background 180ms ease; }
.icon-button:hover { background: var(--primary-hover); }
.icon-button svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.status-panel { display: flex; gap: 14px; margin-top: 24px; padding: 16px; background: var(--muted); border-radius: 12px; }
.status-panel p { margin: 2px 0 0; color: var(--muted-foreground); font-size: 14px; }
.status-dot { width: 10px; height: 10px; flex: 0 0 auto; margin-top: 7px; background: var(--accent); border-radius: 50%; animation: pulse 1.8s ease-in-out infinite; }
.status-dot.success { background: var(--success); animation: none; }
.status-dot.error { background: var(--danger); animation: none; }

.progress-wrap { margin-top: 20px; }
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
progress { width: 100%; height: 8px; display: block; overflow: hidden; appearance: none; border: 0; border-radius: 99px; background: var(--border); }
progress::-webkit-progress-bar { background: var(--border); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--primary); border-radius: 99px; transition: width 180ms ease; }
progress::-moz-progress-bar { background: var(--primary); border-radius: 99px; }

.primary-button, .secondary-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: background 180ms ease, border-color 180ms ease;
}
.primary-button { width: 100%; color: var(--on-primary); background: var(--primary); border: 1px solid var(--primary); }
.primary-button:hover { background: var(--primary-hover); }
.secondary-button { margin-top: 20px; color: var(--foreground); background: var(--surface); border: 1px solid var(--border); }
.secondary-button:hover { border-color: var(--primary); }
.receiver-file { margin-bottom: 28px; }
.receiver-status { margin: 16px 0 0; color: var(--muted-foreground); font-size: 14px; text-align: center; }
.loading-row { min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted-foreground); }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.error-state { padding: 24px 0; text-align: center; }
.error-state > svg { width: 42px; fill: none; stroke: var(--danger); stroke-width: 1.7; }
.error-state p { color: var(--muted-foreground); }

footer { padding: 24px 16px 32px; color: var(--muted-foreground); font-size: 13px; text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--ring) 40%, transparent); outline-offset: 3px; }

@keyframes pulse { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 520px) {
  .privacy-note { display: none; }
  .page-shell { padding-top: 28px; }
  .hero { margin-bottom: 28px; }
  .lead { font-size: 16px; }
  .transfer-card { border-radius: 18px; }
  .drop-zone { min-height: 190px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #080d18;
    --surface: #111827;
    --foreground: #f8fafc;
    --muted-foreground: #aebbd0;
    --muted: #172238;
    --border: #2b3a55;
    --primary: #60a5fa;
    --primary-hover: #93c5fd;
    --on-primary: #07111f;
    --accent: #fbbf24;
    --success: #4ade80;
    --danger: #f87171;
    --ring: #60a5fa;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
