/* =========================================================================
   KYC — Activos Digitales
   Hoja de estilos compartida por personas.html y juridicos.html
   ========================================================================= */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

:root{
  /* Heredado de la paleta ya existente del sitio (--main-bg-color, --accent-color, etc.) */
  --bg: #0A0A0A;
  --bg-panel: #12161C;
  --bg-field: #171C24;
  --bg-field-focus: #1B222D;
  --border: #232B36;
  --border-strong: #055C98;
  --accent: #055C98;
  --accent-bright: #2F8FD1;
  --success: #00E28A;
  --success-dim: #0B3A2C;
  --danger: #EF5B5B;
  --danger-dim: #3A1414;
  --text: #F5F7FA;
  --text-muted: #8CA0B3;
  --text-faint: #4C5A68;
  --radius-lg: 10px;
  --radius-md: 6px;
  --radius-sm: 4px;
  --maxw: 1080px;
}

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

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.mono{
  font-family: "IBM Plex Mono", monospace;
}

a{ color: inherit; }

button{ font-family: inherit; }

.visually-hidden{
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Barra de progreso KYC (bajo el navbar compartido del sitio) ---------- */

.kyc-page{
  padding-top: 120px; /* deja espacio para el navbar fijo del sitio (.navbar) */
}

.kyc-subheader{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding: 16px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.kyc-progress-label{
  font-size: 13px;
  color: var(--text-muted);
  font-family: "IBM Plex Mono", monospace;
}

.lang-toggle{
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.lang-toggle:hover{ border-color: var(--accent-bright); color: var(--text); }

/* ---------- Estructura principal ---------- */

.kyc-shell{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(20px, 4vw, 56px) 80px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(24px, 5vw, 64px);
}

@media (max-width: 800px){
  .kyc-shell{ grid-template-columns: 1fr; }
}

/* ---------- Riel de pasos ---------- */

.kyc-rail{
  display: flex;
  flex-direction: column;
  gap: 2px;
}

@media (max-width: 800px){
  .kyc-rail{
    flex-direction: row;
    align-items: center;
    gap: 0;
    margin-bottom: 28px;
  }
}

.kyc-rail__item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-left: 2px solid var(--border);
  padding-left: 16px;
  color: var(--text-faint);
  transition: color .2s ease, border-color .2s ease;
}

@media (max-width: 800px){
  /* En móvil el riel se comprime a círculos numerados unidos por una línea;
     el nombre del paso ya se lee en "Paso X de N" dentro del encabezado. */
  .kyc-rail__item{
    border-left: none;
    padding: 0;
    flex: 1;
    position: relative;
  }
  .kyc-rail__item:not(:last-child)::after{
    content: "";
    position: absolute;
    top: 50%;
    left: calc(50% + 17px);
    right: calc(-50% + 17px);
    height: 1px;
    background: var(--border);
    transform: translateY(-50%);
  }
  .kyc-rail__item.is-done:not(:last-child)::after{ background: var(--success); }
  .kyc-rail__item{ flex-direction: column; gap: 6px; }
  .kyc-rail__label{
    font-size: 11px;
    text-align: center;
    display: none;
  }
  .kyc-rail__item.is-active .kyc-rail__label{
    display: block;
  }
}

.kyc-rail__item.is-active{
  color: var(--text);
  border-left-color: var(--accent-bright);
}
@media (max-width: 800px){
  .kyc-rail__item.is-active{ border-bottom-color: var(--accent-bright); }
}

.kyc-rail__item.is-done{ color: var(--text-muted); }

.kyc-rail__num{
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kyc-rail__item.is-done .kyc-rail__num{
  background: var(--success);
  border-color: var(--success);
  color: #05130D;
}
.kyc-rail__item.is-active .kyc-rail__num{
  border-color: var(--accent-bright);
  background: var(--accent-bright);
  color: #05130D;
}

.kyc-rail__label{ font-size: 14px; }

/* ---------- Panel de contenido ---------- */

.kyc-panel{
  min-width: 0;
}

.kyc-step{ display: none; }
.kyc-step.is-active{ display: block; animation: kyc-step-in .32s ease both; }

@keyframes kyc-step-in{
  from{ opacity: 0; transform: translateY(8px); }
  to{ opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce){
  .kyc-step.is-active{ animation: none; }
}

.kyc-step__title{
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  margin: 0 0 6px;
}

.kyc-step__hint{
  color: var(--text-muted);
  font-size: 14.5px;
  margin: 0 0 32px;
  max-width: 62ch;
}

/* ---------- Campos ---------- */

.field-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 560px){
  .field-grid{ grid-template-columns: 1fr; }
}

.field{
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 20px;
}

.field label{
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea{
  background: var(--bg-field);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14.5px;
  font-family: "IBM Plex Mono", monospace;
  transition: border-color .15s ease, background .15s ease;
  width: 100%;
}

.field textarea{
  font-family: "Poppins", sans-serif;
  resize: vertical;
  min-height: 84px;
}

.field select{ cursor: pointer; }

.field input:focus,
.field select:focus,
.field textarea:focus{
  outline: none;
  border-color: var(--accent-bright);
  background: var(--bg-field-focus);
}

.field input:invalid:not(:placeholder-shown){
  border-color: var(--danger);
}

.field-error{
  font-size: 12.5px;
  color: var(--danger);
  display: none;
}
.field.has-error .field-error{ display: block; }
.field.has-error input,
.field.has-error select{ border-color: var(--danger); }

/* ---------- Zonas de carga de archivos ---------- */

.upload{
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-field);
  padding: 20px;
  margin-bottom: 18px;
  transition: border-color .15s ease, background .15s ease;
}

.upload.is-dragover{
  border-color: var(--accent-bright);
  background: var(--bg-field-focus);
}

.upload.has-file{
  border-style: solid;
  border-color: var(--success);
}

.upload__top{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.upload__label{
  font-size: 14.5px;
  font-weight: 600;
  margin: 0 0 4px;
}

.upload__note{
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0;
  max-width: 46ch;
}

.upload__note strong{ color: var(--text); }

.upload__button{
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--accent-bright);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
  flex-shrink: 0;
}
.upload__button:hover{ background: var(--accent); color: var(--text); }

.upload__filename{
  margin-top: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  color: var(--success);
  display: none;
  align-items: center;
  gap: 8px;
  word-break: break-all;
}
.upload.has-file .upload__filename{ display: flex; }

.upload__filename button{
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0;
}
.upload__filename button:hover{ color: var(--danger); }

/* ---------- Bloques de política (paso final) ---------- */

.policy{
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  overflow: hidden;
}

.policy__head{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  background: var(--bg-field);
}

.policy__check{
  width: 20px; height: 20px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  background: transparent;
}
.policy__check.is-checked{
  background: var(--success);
  border-color: var(--success);
}
.policy__check.is-checked::after{
  content: "";
  position: absolute;
  left: 6px; top: 2px;
  width: 5px; height: 10px;
  border-right: 2px solid #05130D;
  border-bottom: 2px solid #05130D;
  transform: rotate(45deg);
}

.policy__title{
  flex: 1;
  font-size: 14.5px;
  font-weight: 500;
}

.policy__caret{
  color: var(--text-faint);
  font-size: 12px;
  transition: transform .2s ease;
}
.policy.is-open .policy__caret{ transform: rotate(180deg); }

.policy__body{
  display: none;
  padding: 0 18px 18px 50px;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.65;
}
.policy.is-open .policy__body{ display: block; }

/* ---------- Resumen (paso de revisión) ---------- */

.summary{
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 24px;
}

.summary__row{
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.summary__row:last-child{ border-bottom: none; }

.summary__key{ color: var(--text-muted); }
.summary__value{
  font-family: "IBM Plex Mono", monospace;
  text-align: right;
  word-break: break-word;
}

/* ---------- Navegación entre pasos ---------- */

.kyc-nav{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.btn{
  border-radius: var(--radius-sm);
  padding: 13px 26px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}

.btn-primary{
  background: var(--accent-bright);
  color: #04121C;
}
.btn-primary:hover{ background: #48A4E0; }
.btn-primary:disabled{ opacity: .5; cursor: not-allowed; }

.btn-ghost{
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover{ color: var(--text); border-color: var(--text-faint); }

.btn-ghost:disabled{ opacity: 0; pointer-events: none; }

/* ---------- Aviso ---------- */

.notice{
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: rgba(5, 92, 152, .1);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.notice strong{ color: var(--text); }

/* ---------- Overlay modal (estado de envío / resultado) ---------- */

.kyc-modal-layer{
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 9, .78);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.kyc-modal-layer.is-open{ display: flex; }

.kyc-modal{
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  padding: 32px;
  text-align: center;
}

.kyc-modal__icon{
  width: 52px; height: 52px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.kyc-modal__icon.is-loading{
  border: 2px solid var(--border);
  border-top-color: var(--accent-bright);
  animation: kyc-spin .8s linear infinite;
}
.kyc-modal__icon.is-success{ background: var(--success-dim); color: var(--success); }
.kyc-modal__icon.is-error{ background: var(--danger-dim); color: var(--danger); }

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

.kyc-modal__title{ font-size: 17px; font-weight: 700; margin: 0 0 8px; }
.kyc-modal__text{ font-size: 13.5px; color: var(--text-muted); margin: 0 0 22px; line-height: 1.6; }

.kyc-modal__actions{ display: flex; gap: 10px; justify-content: center; }

/* ---------- Línea legal (encima del footer compartido del sitio) ---------- */

.kyc-legal-line{
  border-top: 1px solid var(--border);
  padding: 26px clamp(20px, 4vw, 56px);
  text-align: center;
  font-size: 12.5px;
  color: var(--text-faint);
}
