/* DocTransfer — shared styles. DocFila design tokens (navy/teal) mirror
   the existing drop-web/admin-web look so the brand feels unified. */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --navy: #3B5EA6;
  --navy-dark: #2D4A8A;
  --navy-light: #4B72BF;
  --navy-bg: rgba(59, 94, 166, 0.08);
  --teal: #2A9D8F;
  --teal-dark: #218377;
  --teal-bg: rgba(42, 157, 143, 0.08);
  --text-primary: #0D1B2A;
  --text-secondary: #4A5568;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --surface: #FFFFFF;
  --surface-elevated: #FFFFFF;
  --background: #F0F2F5;
  --success: #059669;
  --success-bg: rgba(5, 150, 105, 0.08);
  --warning: #D97706;
  --warning-bg: rgba(217, 119, 6, 0.08);
  --error: #DC2626;
  --error-bg: rgba(220, 38, 38, 0.06);
  --shadow-sm: 0 1px 2px rgba(13, 27, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(13, 27, 42, 0.06);
  --shadow-lg: 0 10px 30px rgba(13, 27, 42, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

input, textarea, select {
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  outline: none;
  width: 100%;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-bg);
}

/* ── header ────────────────────────────────────────────────────────── */
.dt-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.dt-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.dt-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text-primary);
}
.dt-brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.5px;
}
.dt-brand-suffix { color: var(--text-muted); font-weight: 500; margin-left: 6px; }
.dt-header-nav { display: flex; gap: 16px; align-items: center; }
.dt-header-nav a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

/* ── primary container ─────────────────────────────────────────────── */
.dt-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px 80px;
}
.dt-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  width: 100%;
  max-width: 560px;
}
.dt-card-wide { max-width: 760px; }
.dt-card-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
.dt-card-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ── dropzone ──────────────────────────────────────────────────────── */
.dt-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  transition: border-color 150ms ease, background 150ms ease;
  cursor: pointer;
}
.dt-dropzone.is-hover {
  border-color: var(--navy);
  background: var(--navy-bg);
}
.dt-dropzone-icon {
  width: 56px;
  height: 56px;
  background: var(--navy-bg);
  color: var(--navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 22px;
}
.dt-dropzone-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.dt-dropzone-sub {
  font-size: 13px;
  color: var(--text-muted);
}
.dt-dropzone-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.dt-link {
  background: transparent;
  color: var(--navy);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 10px;
}
.dt-link:hover { text-decoration: underline; }

/* ── file list ─────────────────────────────────────────────────────── */
.dt-file-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.dt-file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--background);
}
.dt-file-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--navy-bg);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}
.dt-file-meta { flex: 1; min-width: 0; }
.dt-file-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dt-file-size { font-size: 12px; color: var(--text-muted); }
.dt-file-action { color: var(--text-muted); padding: 6px; border-radius: 6px; }
.dt-file-action:hover { background: var(--border-light); color: var(--error); }

.dt-file-progress {
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.dt-file-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--teal));
  width: 0%;
  transition: width 120ms linear;
}
.dt-file-row[data-state="error"] .dt-file-progress-bar { background: var(--error); }
.dt-file-row[data-state="done"]  .dt-file-progress-bar { background: var(--success); }

/* ── settings panel ────────────────────────────────────────────────── */
.dt-tabs {
  display: flex;
  gap: 4px;
  margin: 20px 0 16px;
  padding: 4px;
  background: var(--background);
  border-radius: var(--radius-sm);
}
.dt-tab {
  flex: 1;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 6px;
  text-align: center;
  transition: all 120ms ease;
}
.dt-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.dt-field { margin-bottom: 14px; }
.dt-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.dt-field-help {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.dt-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dt-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.dt-toggle-label { font-size: 14px; font-weight: 500; }
.dt-toggle-help  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.dt-toggle {
  position: relative;
  width: 40px; height: 22px;
  flex-shrink: 0;
}
.dt-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.dt-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 11px;
  transition: background 120ms ease;
}
.dt-toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: transform 150ms ease;
}
.dt-toggle input:checked + .dt-toggle-track { background: var(--navy); }
.dt-toggle input:checked + .dt-toggle-track .dt-toggle-thumb { transform: translateX(18px); }

/* ── primary button ───────────────────────────────────────────────── */
.dt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-sm);
  transition: background 120ms ease, transform 50ms ease;
  width: 100%;
}
.dt-btn:hover:not(:disabled) { background: var(--navy-dark); }
.dt-btn:active:not(:disabled) { transform: translateY(1px); }
.dt-btn:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }
.dt-btn-teal { background: var(--teal); }
.dt-btn-teal:hover:not(:disabled) { background: var(--teal-dark); }
.dt-btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.dt-btn-ghost:hover:not(:disabled) { background: var(--background); }
.dt-btn-row { display: flex; gap: 10px; margin-top: 8px; }
.dt-btn-row .dt-btn { flex: 1; }

/* ── alerts & banners ──────────────────────────────────────────────── */
.dt-alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.dt-alert-info    { background: var(--navy-bg);    color: var(--navy-dark); }
.dt-alert-success { background: var(--success-bg); color: var(--success); }
.dt-alert-warning { background: var(--warning-bg); color: var(--warning); }
.dt-alert-error   { background: var(--error-bg);   color: var(--error); }

/* ── success state ─────────────────────────────────────────────────── */
.dt-success-icon {
  width: 72px;
  height: 72px;
  background: var(--success-bg);
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
}
.dt-share-link-row {
  display: flex;
  gap: 8px;
  margin: 8px 0 16px;
}
.dt-share-link-row input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

/* ── footer ────────────────────────────────────────────────────────── */
.dt-footer {
  padding: 24px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── utility ───────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--navy-bg);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: dt-spin 700ms linear infinite;
  display: inline-block;
}
@keyframes dt-spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .dt-card { padding: 22px 18px; border-radius: var(--radius-lg); }
  .dt-row-2 { grid-template-columns: 1fr; }
  .dt-header { padding: 12px 16px; }
}
