/* ============================================================
   Section 6 — Document Upload
   ============================================================ */

/* Summary + adviser toggle */
.doc-summary {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding: 18px 22px; margin-bottom: 22px;
  background: linear-gradient(135deg, rgba(27,48,88,.05), rgba(128,143,114,.06));
  border: 1px solid var(--line); border-radius: var(--r-lg);
}
.doc-summary-left { display: flex; align-items: center; gap: 18px; min-width: 260px; flex: 1; }
.doc-summary-count {
  font-size: 36px; font-weight: 800; color: var(--navy);
  letter-spacing: 0; line-height: 1;
}
.doc-summary-count span { color: var(--mute); font-size: 22px; font-weight: 700; }
.doc-summary-label {
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--mute); margin-bottom: 6px;
}
.doc-summary-bar {
  width: 260px; max-width: 60vw; height: 8px;
  background: rgba(0,0,0,.06); border-radius: 4px; overflow: hidden;
}
.doc-summary-fill {
  height: 100%; background: var(--green);
  border-radius: 4px; transition: width var(--t-med) var(--ease);
}

.doc-adviser-toggle {
  padding: 10px 16px; border-radius: var(--r-md);
  background: white; border: 1.5px dashed var(--line);
  font-size: 12px; font-weight: 800; color: var(--mute);
  letter-spacing: 0.03em;
  transition: all var(--t-fast) var(--ease);
}
.doc-adviser-toggle:hover { border-color: var(--accent); color: var(--accent); }
.doc-adviser-toggle.on {
  background: var(--olive-deep); color: var(--amber-light); border: 1.5px solid var(--olive-deep);
}

/* Adviser catalogue */
.doc-catalogue {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.doc-cat-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: var(--off-white); cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.doc-cat-item:hover { border-color: var(--line-strong); }
.doc-cat-item.on {
  background: rgba(128,143,114,.06);
  border-color: var(--olive-deep);
}
.doc-cat-item input[type="checkbox"] { margin-top: 2px; accent-color: var(--olive-deep); }
.doc-cat-body { flex: 1; min-width: 0; }
.doc-cat-label {
  font-size: 13px; font-weight: 800; color: var(--navy);
  display: flex; align-items: center; gap: 8px;
}
.doc-req-tag {
  font-size: 9px; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent);
  padding: 2px 6px; border-radius: var(--r-pill);
  background: var(--accent-soft);
}
.doc-cat-hint { font-size: 12px; color: var(--mute); margin-top: 3px; line-height: 1.4; }
.doc-cat-check {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--olive-deep); font-weight: 800; font-size: 13px;
}
.doc-cat-item.on .doc-cat-check { background: var(--olive-deep); color: var(--white); }

/* Client document rows */
.doc-list { display: flex; flex-direction: column; gap: 14px; }
.doc-row {
  border: 1.5px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 20px; background: white;
  transition: border-color var(--t-fast) var(--ease);
}
.doc-row.complete { border-color: var(--olive-deep); background: rgba(128,143,114,.03); }
.doc-row.drag { border-color: var(--accent); background: var(--accent-soft); }

.doc-row-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.doc-row-status {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.doc-row .doc-row-status { background: var(--off-white); color: var(--mute-2); }
.doc-row.complete .doc-row-status { background: var(--olive-deep); color: var(--white); }
.doc-check { font-size: 18px; font-weight: 800; }
.doc-pending { font-size: 28px; line-height: 0.4; }

.doc-row-main { flex: 1; min-width: 0; }
.doc-row-label {
  font-size: 15px; font-weight: 800; color: var(--navy);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.doc-row-pill {
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 3px 8px; border-radius: var(--r-pill);
  background: var(--off-white); color: var(--mute);
}
.doc-row-pill.ok { background: var(--olive-deep); color: var(--white); }
.doc-row-pill.uploading { background: var(--accent-soft); color: var(--accent); }

/* Compact dropzone — used when the row already has at least one file so the
   "drop more" affordance stays visible without dominating the row. */
.doc-dropzone-compact {
  padding: 10px 14px;
  margin-top: 8px;
}
.doc-dropzone-compact .doc-dropzone-icon { width: 28px; height: 28px; font-size: 14px; }
.doc-dropzone-compact .doc-dropzone-main { font-size: 12px; }

/* Pending upload row — spinner + tinted background while the file is in flight. */
.doc-file-pending { background: var(--accent-soft); border-color: var(--accent); }
.doc-spinner {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--accent-soft); border-top-color: var(--accent);
  animation: docSpin 0.8s linear infinite;
}
@keyframes docSpin { to { transform: rotate(360deg); } }
.doc-row-hint { font-size: 13px; color: var(--mute); margin-top: 4px; line-height: 1.5; }
.doc-row-accept {
  font-size: 11px; font-weight: 700; color: var(--mute-2);
  margin-top: 6px; letter-spacing: 0.03em;
  font-family: ui-monospace, monospace;
}

/* Dropzone */
.doc-dropzone {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-md);
  background: var(--off-white); cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.doc-dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.doc-dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.doc-dropzone-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: white; color: var(--accent);
  font-size: 16px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line);
}
.doc-dropzone-main { font-size: 13px; color: var(--navy); font-weight: 600; }
.doc-dropzone-main strong { font-weight: 800; }
.doc-dropzone-main .link { color: var(--accent); font-weight: 800; text-decoration: underline; }

/* Uploaded file list */
.doc-files { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.doc-files-count {
  font-size: 12px; font-weight: 700; color: var(--mute);
  letter-spacing: 0.02em; margin-bottom: 2px;
}
.doc-file {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--off-white);
  border-radius: var(--r-md); border: 1px solid var(--line);
}
.doc-file-icon {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  background: var(--olive-deep); color: var(--amber-light);
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.doc-file-meta { flex: 1; min-width: 0; }
.doc-file-name {
  font-size: 13px; font-weight: 700; color: var(--navy);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-file-sub { font-size: 11px; color: var(--mute); margin-top: 2px; font-weight: 600; }
.doc-file-remove {
  font-size: 11px; font-weight: 700; color: var(--magenta);
  letter-spacing: 0.04em; padding: 4px 8px; border-radius: var(--r-sm);
}
.doc-file-remove:hover { background: rgba(166,65,47,.08); }

/* Submit-time "documents attached" confirmation summary */
.doc-submit-summary { margin-top: 18px; }
.doc-submit-intro { font-size: 13px; color: var(--navy); line-height: 1.5; margin-bottom: 12px; }
.doc-submit-list { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.doc-submit-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--r-sm);
  background: var(--off-white); border: 1px solid var(--line);
}
.doc-submit-mark {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: var(--white);
}
.doc-submit-item.ok .doc-submit-mark { background: var(--green); }
.doc-submit-item.missing .doc-submit-mark { background: #F59E0B; }
.doc-submit-item.skip .doc-submit-mark { background: var(--mute); }
.doc-submit-item.missing { border-color: #F5C36B; background: #FFF7E0; }
.doc-submit-label { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; color: var(--navy); }
.doc-submit-note { font-size: 12px; font-weight: 600; color: var(--mute); text-align: right; white-space: nowrap; }
@media (max-width: 560px) {
  .doc-submit-item { flex-wrap: wrap; }
  .doc-submit-note { text-align: left; width: 100%; padding-left: 32px; }
}

@media (max-width: 720px) {
  .doc-catalogue { grid-template-columns: 1fr; }
  .doc-summary-count { font-size: 28px; }
  .doc-summary-bar { width: 100%; }
}


/* ── Document detail "?" button ── */
.doc-info-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(27,48,88,.1);
  color: var(--blue, #1B3058);
  border: 1px solid rgba(27,48,88,.2);
  font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, transform .1s;
  line-height: 1;
  padding: 0;
}
.doc-info-btn:hover {
  background: var(--blue, #1B3058);
  color: white;
}
.doc-info-btn:active { transform: scale(0.95); }
.doc-info-btn:focus-visible {
  outline: 2px solid var(--blue, #1B3058);
  outline-offset: 2px;
}

/* ── Document details modal ── */
.doc-details-backdrop {
  position: fixed; inset: 0;
  background: rgba(63,74,54, 0.55);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 9000;
  animation: ddFade 0.18s ease-out;
}
@keyframes ddFade { from { opacity: 0; } to { opacity: 1; } }
.doc-details-modal {
  background: white;
  border-radius: var(--r-lg, 12px);
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(63,74,54, 0.35);
  animation: ddPop 0.22s cubic-bezier(.2,.7,.3,1);
}
@keyframes ddPop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.doc-details-head {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line, #DDD8C6);
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
}
.doc-details-head h3 {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--navy, #1B3058);
  line-height: 1.25;
}
.doc-details-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--off-white, #FAF8F2);
  color: var(--navy, #1B3058);
  border: none;
  font-size: 22px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}
.doc-details-close:hover { background: var(--line, #DDD8C6); }
.doc-details-body {
  padding: 18px 24px;
  overflow-y: auto;
  flex: 1;
}
.doc-details-body p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink, #2C2C2C);
  margin: 0 0 14px;
}
.doc-details-body p:last-child { margin-bottom: 0; }
.doc-details-list {
  margin: 0 0 16px;
  padding: 0 0 0 4px;
  list-style: none;
}
.doc-details-list li {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink, #2C2C2C);
  padding: 6px 0 6px 20px;
  position: relative;
}
.doc-details-list li::before {
  content: '';
  position: absolute;
  left: 4px; top: 14px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green, #808F72);
}
.doc-details-foot {
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line, #DDD8C6);
  display: flex;
  justify-content: flex-end;
  background: var(--off-white, #FAF8F2);
  border-radius: 0 0 var(--r-lg, 12px) var(--r-lg, 12px);
}
@media (max-width: 600px) {
  .doc-details-modal { max-height: calc(100vh - 24px); }
  .doc-details-head { padding: 18px 18px 14px; }
  .doc-details-head h3 { font-size: 19px; }
  .doc-details-body { padding: 16px 18px; }
  .doc-details-foot { padding: 12px 18px 14px; }
}
