@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --navy: #1B2B5E;
  --navy-light: #2a3f80;
  --gold: #C9A84C;
  --gold-light: #e8c96a;
  --bg: #F4F5F7;
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --red: #dc3545;
  --green: #28a745;
  --amber: #fff3cd;
  --amber-border: #ffc107;
  --shadow: 0 2px 16px rgba(27,43,94,0.08);
  --shadow-lg: 0 8px 32px rgba(27,43,94,0.12);
  --radius: 10px;
  --radius-lg: 16px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--gray-800);
  min-height: 100vh;
}

/* ─── LAYOUT ─── */
.page-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ─── HEADER ─── */
.kyc-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 0 28px;
}

.logo-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(201,168,76,0.2);
}

.logo-circle svg { width: 32px; height: 32px; }

.kyc-header h1 {
  font-family: 'DM Sans', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 28px;
  text-align: center;
}

/* ─── STEP INDICATOR ─── */
.steps {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 520px;
  position: relative;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  z-index: 1;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-500);
  transition: all 0.3s;
}

.step-circle.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(27,43,94,0.3);
}

.step-circle.done {
  background: var(--white);
  border-color: var(--navy);
  color: var(--navy);
}

.step-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
}

.step-label.active { color: var(--navy); }
.step-label.done { color: var(--navy); }

.step-line {
  flex: 1;
  height: 2px;
  background: var(--gray-300);
  margin-bottom: 20px;
  position: relative;
  z-index: 0;
}
.step-line.done { background: var(--navy); }

/* ─── NOTICE BOX ─── */
.notice-box {
  background: #EEF2FF;
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 13.5px;
  color: var(--navy);
  line-height: 1.6;
}

.notice-box .icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

.warning-box {
  background: var(--amber);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #856404;
  line-height: 1.5;
}

/* ─── CARD ─── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 28px;
}

/* ─── SECTION ─── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  border-left: 3px solid var(--gold);
  padding-left: 10px;
  margin-bottom: 18px;
  margin-top: 28px;
}

.section-label:first-child { margin-top: 0; }

/* ─── FORM GRID ─── */
.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.cols-1-2 { grid-template-columns: 1fr 2fr; }
.form-grid.cols-2-1 { grid-template-columns: 2fr 1fr; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 6px;
}

.required { color: var(--red); }

.badge-optional {
  font-size: 10px;
  font-weight: 600;
  background: #FFF8E7;
  color: var(--gold);
  border: 1px solid var(--gold-light);
  border-radius: 4px;
  padding: 1px 6px;
}

.badge-auto {
  font-size: 10px;
  font-weight: 600;
  background: #d4edda;
  color: var(--green);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: auto;
}

/* ─── INPUTS ─── */
input, select, textarea {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  background: var(--white);
  color: var(--gray-800);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,43,94,0.08);
}

input.autofilled {
  background: #f0fff4;
  border-color: var(--green);
}

input::placeholder { color: var(--gray-400); }

select { cursor: pointer; }

/* ─── SEARCH ROW ─── */
.search-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.search-row input { flex: 1; }

.btn-search {
  background: var(--gold);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
  font-family: 'DM Sans', sans-serif;
}

.btn-search:hover { background: var(--gold-light); }
.btn-search:disabled { opacity: 0.6; cursor: not-allowed; }

.search-hint {
  font-size: 11.5px;
  color: var(--gray-500);
  font-style: italic;
  margin-top: 4px;
}

/* ─── DOC BLOCKS ─── */
.doc-blocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.doc-block {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--gray-100);
}

.doc-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.doc-block-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-principal {
  font-size: 10px;
  font-weight: 700;
  background: var(--navy);
  color: var(--white);
  border-radius: 4px;
  padding: 1px 6px;
}

/* ─── TOGGLE ─── */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-600);
  font-weight: 500;
}

.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-300);
  border-radius: 22px;
  cursor: pointer;
  transition: 0.3s;
}

.toggle-slider:before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle input:checked + .toggle-slider { background: var(--navy); }
.toggle input:checked + .toggle-slider:before { transform: translateX(18px); }

/* ─── PASSPORT COLLAPSED ─── */
.passport-placeholder {
  font-size: 12.5px;
  color: var(--gray-500);
  font-style: italic;
  text-align: center;
  padding: 12px 0;
}

/* ─── UPLOAD ZONES ─── */
.upload-section { margin-bottom: 24px; }

.upload-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--navy);
  background: #f0f3ff;
}

.upload-zone.uploaded {
  border-color: var(--green);
  background: #f0fff4;
}

.upload-icon { font-size: 36px; margin-bottom: 10px; color: var(--gray-400); }
.upload-zone.uploaded .upload-icon { color: var(--green); }

.upload-zone h4 { font-size: 14px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.upload-zone p { font-size: 12px; color: var(--gray-500); margin-bottom: 12px; }

.upload-zone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.btn-choose {
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  pointer-events: none;
}

.upload-preview {
  position: relative;
  display: inline-block;
  margin-top: 10px;
}

.upload-preview img {
  max-width: 160px;
  max-height: 100px;
  border-radius: 6px;
  border: 2px solid var(--green);
  object-fit: cover;
}

.btn-remove-upload {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  background: var(--red);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.upload-note {
  font-size: 12px;
  color: var(--gold);
  font-style: italic;
  margin-top: 8px;
}

/* ─── TIMEMARK BANNER ─── */
.timemark-banner {
  background: #FFFBEB;
  border: 1px solid var(--amber-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 24px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.5;
}

/* ─── ACCORDION (Paso 4) ─── */
.accordion-section {
  border-top: 2px solid rgba(201,168,76,0.3);
}

.accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  cursor: pointer;
  list-style: none;
  transition: background 0.2s;
}

.accordion-summary:hover { background: var(--gray-100); }

.accordion-summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--navy);
  font-size: 14px;
}

.accordion-summary-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-edit-section {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  background: none;
  border: 1px solid var(--navy);
  border-radius: 5px;
  padding: 3px 10px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
}

.btn-edit-section:hover { background: var(--navy); color: white; }

.accordion-arrow {
  font-size: 18px;
  color: var(--gray-400);
  transition: transform 0.3s;
}

details[open] .accordion-arrow { transform: rotate(180deg); }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

.accordion-content {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  border-top: 1px solid var(--gray-200);
}

.data-field-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  margin-bottom: 3px;
}

.data-field-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}

/* ─── SIGNATURE ─── */
.signature-section h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
}

.signature-canvas-wrap {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  background: var(--white);
  padding: 16px;
  box-shadow: var(--shadow);
}

#signatureCanvas {
  width: 100%;
  height: 200px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  cursor: crosshair;
  display: block;
  background: white;
}

.sig-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--gray-400);
  pointer-events: none;
  font-size: 13px;
}

.sig-placeholder span { font-size: 32px; display: block; margin-bottom: 6px; }
.sig-canvas-container { position: relative; }

.sig-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 14px;
}

/* ─── BUTTONS ─── */
.btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  padding: 11px 24px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: var(--navy);
  color: white;
}
.btn-primary:hover { background: var(--navy-light); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(27,43,94,0.25); }

.btn-outline {
  background: white;
  color: var(--navy);
  border: 2px solid var(--navy);
}
.btn-outline:hover { background: var(--navy); color: white; }

.btn-ghost {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1.5px solid var(--gray-300);
}
.btn-ghost:hover { background: var(--gray-200); }

.btn-gold {
  background: var(--gold);
  color: white;
}
.btn-gold:hover { background: var(--gold-light); }

.btn-lg {
  width: 100%;
  justify-content: center;
  padding: 15px;
  font-size: 15px;
  border-radius: 12px;
}

/* ─── FORM ACTIONS ─── */
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
  margin-top: 28px;
  gap: 12px;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}

/* ─── LEGAL ─── */
.legal-box {
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.6;
  margin-top: 16px;
}

/* ─── DOCS GRID ─── */
.docs-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.doc-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.doc-thumb-box {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  font-size: 24px;
}

.doc-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doc-thumb-status {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 14px;
}

.doc-thumb-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gray-500);
  text-align: center;
  letter-spacing: 0.3px;
}

/* ─── SUCCESS ─── */
.success-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.success-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  text-align: center;
  max-width: 480px;
  width: 100%;
}

.success-icon {
  width: 72px;
  height: 72px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 32px;
  animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.success-card h2 { font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 12px; }
.success-card p { font-size: 14px; color: var(--gray-600); line-height: 1.6; margin-bottom: 28px; }

.security-badge {
  margin-top: 24px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ─── FOOTER ─── */
.kyc-footer {
  text-align: center;
  padding: 20px;
  font-size: 11.5px;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-200);
  margin-top: 20px;
  line-height: 1.8;
}

/* ─── SPINNER ─── */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── RESPONSIVE ─── */
@media (max-width: 680px) {
  .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .form-grid.cols-1-2, .form-grid.cols-2-1 { grid-template-columns: 1fr; }
  .doc-blocks { grid-template-columns: 1fr; }
  .accordion-content { grid-template-columns: 1fr 1fr; }
  .docs-thumbs { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 20px; }
  .steps { max-width: 100%; }
  .step-label { font-size: 8px; }
}
