/* ===================================================
   wizard.css — Wizard KYC / Steps
   =================================================== */

/* ---------- Contenedor del step ---------- */
.step {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ---------- Barra de progreso ---------- */
.step-progress {
    background: var(--bg-card);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 16px 20px 14px;
    border-bottom: 1px solid var(--border-color);
}
.step-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.step-progress-title {
    font-size: .9375rem;
    font-weight: 600;
    color: var(--text-primary);
}
.step-progress-counter {
    font-size: .8125rem;
    color: var(--text-muted);
}
.step-progress-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 99px;
    overflow: hidden;
}
.step-progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 99px;
    transition: width .4s ease;
}

/* ---------- Cuerpo del step ---------- */
.step-body {
    background: var(--bg-card);
    padding: 20px;
    flex: 1;
}
.step-subtitle {
    color: var(--text-secondary);
    font-size: .9375rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ---------- Formulario del step ---------- */
.step-form {
    display: flex;
    flex-direction: column;
}

/* ---------- Footer del step ---------- */
.step-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}
.step-footer .btn { flex: 1; }
.step-footer .btn-secondary { flex: 0 0 auto; min-width: 90px; }

/* ===================================================
   Landing
   =================================================== */
.landing-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.landing-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dk) 100%);
    padding: 32px 24px;
    text-align: center;
    color: #fff;
}
.landing-logo {
    height: 48px;
    max-width: 160px;
    object-fit: contain;
    margin-bottom: 16px;
}
.landing-title { color: #fff; font-size: 1.375rem; margin-bottom: 6px; }
.landing-subtitle { opacity: .85; font-size: .9375rem; }
.landing-body { padding: 24px; }
.landing-producto {
    background: var(--color-primary-lt);
    border: 1px solid rgba(37,99,235,.2);
    border-radius: var(--border-radius-sm);
    padding: 14px 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.landing-producto:hover { border-color: var(--color-primary); box-shadow: var(--shadow-sm); }
.landing-producto-nombre { font-weight: 600; color: var(--text-primary); }
.landing-producto-desc { font-size: .875rem; color: var(--text-secondary); margin-top: 2px; }
.landing-footer { padding: 16px 24px; border-top: 1px solid var(--border-color); }

/* ===================================================
   OTP
   =================================================== */
.otp-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 32px 24px;
    text-align: center;
    max-width: var(--max-width);
    width: 100%;
}
.otp-icon { font-size: 2.5rem; margin-bottom: 12px; }
.otp-titulo { margin-bottom: 8px; }
.otp-subtitulo { color: var(--text-secondary); font-size: .9375rem; margin-bottom: 28px; }
.otp-canal { font-weight: 600; color: var(--text-primary); }

.otp-grid {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
}
.otp-input {
    width: 46px; height: 54px;
    text-align: center;
    font-size: 1.375rem;
    font-weight: 700;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
    caret-color: var(--color-primary);
}
.otp-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.otp-input.filled { border-color: var(--color-primary); background: var(--color-primary-lt); }

.otp-resend {
    font-size: .875rem;
    color: var(--text-secondary);
    margin-top: 8px;
}
.otp-timer { font-weight: 600; color: var(--color-primary); }
.otp-actions { display: flex; flex-direction: column; gap: 10px; }

/* ===================================================
   Captura de documentos (step-6)
   =================================================== */
.doc-capture-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.doc-capture-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}
.doc-placeholder {
    aspect-ratio: 16/10;
    background: var(--bg-app);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    overflow: hidden;
    position: relative;
    transition: border-color var(--transition);
}
.doc-placeholder-icon { font-size: 1.75rem; }
.doc-placeholder span { font-size: .75rem; color: var(--text-muted); text-align: center; }
.doc-preview {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
.doc-badge {
    position: absolute; top: 8px; right: 8px;
    width: 24px; height: 24px;
    background: var(--color-success);
    color: #fff;
    border-radius: 50%;
    font-size: .75rem;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.btn.captured {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #fff;
}
.ocr-status {
    font-size: .8125rem;
    padding: 6px 10px;
    border-radius: 6px;
    text-align: center;
}
.ocr-procesando { background: #FEF3C7; color: #B45309; }
.ocr-ok         { background: #DCFCE7; color: #15803D; }
.ocr-error      { background: var(--color-error-bg); color: var(--color-error); }

/* ===================================================
   Modal de cámara (compartido doc + bio)
   =================================================== */
.camera-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.85);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.camera-modal-inner {
    background: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    width: 100%;
    max-width: 520px;
    position: relative;
    box-shadow: var(--shadow-lg);
}
.camera-video {
    width: 100%;
    display: block;
    aspect-ratio: 4/3;
    object-fit: cover;
    background: #000;
}
.camera-guide-overlay {
    position: absolute; inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.camera-guide-frame {
    width: 82%;
    aspect-ratio: 85.6/54;
    border: 2.5px solid rgba(255,255,255,.8);
    border-radius: 8px;
    box-shadow: 0 0 0 4000px rgba(0,0,0,.45);
}
.camera-guide-text {
    color: rgba(255,255,255,.9);
    font-size: .875rem;
    font-weight: 500;
    margin-top: 12px;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.camera-controls {
    background: rgba(0,0,0,.7);
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    justify-content: center;
}
.camera-controls .btn { min-width: 120px; }

/* ===================================================
   Biometría (step-7)
   =================================================== */
.bio-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.bio-video-wrap {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}
.bio-video {
    width: 100%; display: block;
    border-radius: 12px;
    background: #000;
    aspect-ratio: 4/3;
    object-fit: cover;
    transform: scaleX(-1); /* espejo */
}
.bio-canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    border-radius: 12px;
}
.bio-instruccion {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    min-height: 2.5em;
    padding: 0 16px;
}
.bio-progress-wrap {
    width: 100%;
    max-width: 320px;
}
.bio-progress-label {
    font-size: .8125rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-align: center;
}
.bio-progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 99px;
    overflow: hidden;
}
.bio-progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 99px;
    transition: width .3s ease;
}
.bio-yaw-wrap {
    width: 100%;
    max-width: 320px;
}
.bio-yaw-label {
    font-size: .8125rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 4px;
}
.bio-yaw-track {
    height: 8px;
    background: var(--border-color);
    border-radius: 99px;
    position: relative;
    overflow: hidden;
}
.bio-yaw-indicator {
    position: absolute;
    top: 0; height: 100%;
    width: 4px;
    background: var(--color-primary);
    border-radius: 99px;
    transition: left .1s ease;
    transform: translateX(-50%);
    left: 50%;
}
.bio-estado {
    text-align: center;
    padding: 12px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
}
.bio-estado-ok      { background: #DCFCE7; color: #15803D; }
.bio-estado-warn    { background: #FEF3C7; color: #B45309; }
.bio-estado-error   { background: var(--color-error-bg); color: var(--color-error); }

/* ===================================================
   Consentimientos (step-8)
   =================================================== */
.con-check-todos-wrap {
    padding: 14px 16px;
    background: var(--color-primary-lt);
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
}
.con-check-all-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: .9375rem;
    cursor: pointer;
}
.con-check-all-label input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--color-primary);
}
.con-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.con-item {
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 14px 16px;
    transition: border-color var(--transition);
}
.con-item:has(.con-check:checked) { border-color: var(--color-primary); }
.con-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.con-item-label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    cursor: pointer;
}
.con-item-label input[type="checkbox"] {
    width: 18px; height: 18px;
    flex-shrink: 0;
    accent-color: var(--color-primary);
}
.con-item-titulo { font-size: .875rem; font-weight: 500; line-height: 1.4; }
.con-detalle {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: .8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.con-nota {
    font-size: .8125rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 12px;
}

/* ===================================================
   Resumen (step-9)
   =================================================== */
.res-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.res-avatar {
    width: 56px; height: 56px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
}
.res-nombre { font-size: 1.125rem; font-weight: 700; margin-bottom: 2px; }
.res-proceso-id { font-size: .8125rem; color: var(--text-muted); font-family: monospace; }

.res-progress-wrap { margin-bottom: 20px; }
.res-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: .8125rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.res-progress-bar { height: 8px; background: var(--border-color); border-radius: 99px; overflow: hidden; }
.res-progress-fill { height: 100%; background: var(--color-primary); border-radius: 99px; transition: width .5s ease; }

.res-seccion {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
}
.res-seccion-header {
    background: var(--bg-app);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}
.res-seccion-titulo { font-weight: 600; font-size: .875rem; }
.res-campos { padding: 12px 16px; }
.res-campo {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: .875rem;
}
.res-campo:last-child { border-bottom: none; padding-bottom: 0; }
.res-campo-label { color: var(--text-secondary); flex-shrink: 0; }
.res-campo-valor { font-weight: 500; text-align: right; word-break: break-word; }

.res-docs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 12px 16px;
}
.res-doc-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px;
    border-radius: var(--border-radius-sm);
    border: 1.5px solid var(--border-color);
    font-size: .8125rem;
    text-align: center;
    color: var(--text-muted);
}
.res-doc-item.done {
    border-color: var(--color-success);
    background: #F0FDF4;
    color: #15803D;
}
.res-doc-icon { font-size: 1.125rem; font-weight: 700; }
.res-legal {
    font-size: .8125rem;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 14px;
    background: var(--bg-app);
    border-radius: var(--border-radius-sm);
    margin-top: 8px;
}

/* ===================================================
   Completado
   =================================================== */
.step-completado {
    min-height: 100vh;
    background: var(--bg-app);
    justify-content: center;
}
.comp-body {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 36px 24px;
    max-width: var(--max-width);
    width: 100%;
    text-align: center;
}

/* SVG check animado */
.comp-icon-wrap { margin-bottom: 24px; }
.comp-icon-circle {
    width: 80px; height: 80px;
    margin: 0 auto;
}
.comp-check-svg {
    width: 80px; height: 80px;
}
.comp-check-circle {
    stroke: var(--color-success);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: dash-circle .6s ease forwards;
}
.comp-check-path {
    stroke: var(--color-success);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: dash-check .4s .5s ease forwards;
}
@keyframes dash-circle {
    to { stroke-dashoffset: 0; }
}
@keyframes dash-check {
    to { stroke-dashoffset: 0; }
}

.comp-titulo { font-size: 1.5rem; margin-bottom: 10px; }
.comp-subtitulo { color: var(--text-secondary); margin-bottom: 24px; }
.comp-folio {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 14px 24px;
    margin-bottom: 28px;
}
.comp-folio-label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.comp-folio-num { font-size: 1.25rem; font-weight: 700; font-family: monospace; color: var(--text-primary); letter-spacing: .1em; }

.comp-pasos {
    text-align: left;
    margin-bottom: 28px;
}
.comp-pasos-titulo { font-size: .875rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 14px; }
.comp-paso-item {
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
}
.comp-paso-num {
    width: 28px; height: 28px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}
.comp-paso-item p {
    font-size: .875rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.comp-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===================================================
   Responsive ajustes
   =================================================== */
@media (max-width: 380px) {
    .otp-input { width: 40px; height: 48px; font-size: 1.25rem; }
    .otp-grid  { gap: 6px; }
    .doc-capture-grid { grid-template-columns: 1fr; }
    .form-row  { grid-template-columns: 1fr; }
    .res-docs-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 520px) {
    .step-body { padding: 28px; }
    .step-footer { padding: 20px 28px; }
    .bio-video-wrap { max-width: 420px; }
}

/* ===================================================
   Landing Step — Rediseño Índigo
   =================================================== */

.step-landing {
    background: var(--bg-app);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Hero header ── */
.landing-hero {
    background: linear-gradient(150deg, var(--color-primary) 0%, var(--color-primary-dk) 100%);
    padding: 40px 24px 36px;
    text-align: center;
    border-radius: 0 0 24px 24px;
    position: relative;
    overflow: hidden;
}

/* Patrón de puntos sobre el gradiente */
.landing-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.12) 1px, transparent 1px);
    background-size: 18px 18px;
    pointer-events: none;
}

/* Orbe decorativo esquina inferior-derecha */
.landing-hero::after {
    content: '';
    position: absolute;
    bottom: -70px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,.06);
    border-radius: 50%;
    pointer-events: none;
}

.landing-logo-wrap {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.tenant-logo-img {
    height: 48px;
    max-width: 160px;
    object-fit: contain;
}

.landing-logo-fallback {
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,.15);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: 1px solid rgba(255,255,255,.2);
}

.landing-hero-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    letter-spacing: -.01em;
}

.landing-hero-sub {
    font-size: .875rem;
    color: rgba(255,255,255,.75);
    letter-spacing: .02em;
    position: relative;
    z-index: 1;
}

/* ── Body: pasos numerados ── */
.landing-body {
    flex: 1;
    padding: 24px 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.landing-steps-label {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.landing-steps {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.landing-step-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    animation: landing-step-in .38s ease both;
}

.landing-step-item:nth-child(1) { animation-delay: .06s; }
.landing-step-item:nth-child(2) { animation-delay: .12s; }
.landing-step-item:nth-child(3) { animation-delay: .18s; }
.landing-step-item:nth-child(4) { animation-delay: .24s; }

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

.landing-step-num {
    width: 30px;
    height: 30px;
    background: var(--color-primary-lt);
    color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.landing-step-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.landing-step-info strong {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.landing-step-info span {
    font-size: .75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ── Estado de carga (spinner automático via ::before) ── */
.landing-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .875rem;
    color: var(--color-primary);
    padding: 10px 14px;
    background: var(--color-primary-lt);
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(67,56,202,.15);
}

.landing-status::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid var(--color-primary);
    border-top-color: transparent;
    border-radius: 50%;
    flex-shrink: 0;
    animation: landing-spin .7s linear infinite;
}

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

/* ── Footer ── */
.landing-footer {
    padding: 12px 20px 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.landing-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.landing-trust .privacy-note {
    font-size: .75rem;
    color: var(--text-muted);
}
