/* Insolvencia Colombia — Portal del Deudor Styles */

:root {
    --primary: #1e3a5f;
    --primary-light: #2d5a8a;
    --secondary: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #6c757d;
    --border: #dee2e6;
    --white: #ffffff;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 8px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f4f6f9;
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
}

.header-content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--gray);
    font-weight: 400;
}

/* Main */
.main {
    flex: 1;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.busqueda {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
}

.busqueda h2 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.busqueda-help {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.busqueda-form {
    display: flex;
    gap: 0.75rem;
}

.cedula-input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: var(--transition);
}

.cedula-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(45, 90, 138, 0.15);
}

.api-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--gray);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray);
    display: inline-block;
}

.status-dot.online {
    background: var(--secondary);
}

.status-dot.offline {
    background: var(--danger);
}

/* Resultados */
.resultados {
    margin-top: 1.5rem;
}

.resultados-header {
    margin-bottom: 1rem;
}

.resultados-header h2 {
    font-size: 1.15rem;
    color: var(--primary);
}

.caso-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.caso-card:hover {
    box-shadow: var(--shadow-hover);
}

.caso-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-creado { background: #e7f3ff; color: #0d6efd; }
.badge-clasificado { background: #fff3cd; color: #856404; }
.badge-en_negociacion { background: #d1e7ff; color: #084298; }
.badge-acuerdo_logrado { background: #d4edda; color: #155724; }
.badge-sin_acuerdo { background: #f8d7da; color: #721c24; }
.badge-en_levantamiento { background: #e2e3e5; color: #383d41; }
.badge-liquidacion { background: #d6d8db; color: #383d41; }
.badge-cerrado { background: #d1e7dd; color: #0f5132; }

.caso-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.caso-field {
    background: var(--light);
    border-radius: var(--radius);
    padding: 0.6rem 0.9rem;
}

.caso-field span {
    display: block;
    font-size: 0.72rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.caso-field strong {
    font-size: 0.95rem;
    color: var(--dark);
}

.estado-descripcion {
    background: #f0f4fa;
    border-left: 4px solid var(--primary-light);
    padding: 0.75rem 1rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.9rem;
    color: var(--dark);
    margin-bottom: 1rem;
}

.abogado-asignado {
    background: #e8f5e9;
    border-left: 4px solid #2e7d32;
    padding: 0.75rem 1rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.9rem;
    color: var(--dark);
    margin-bottom: 1rem;
}

.caso-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.timeline {
    margin-top: 1.25rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.timeline h4 {
    font-size: 0.85rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.75rem;
}

.timeline-item {
    display: flex;
    gap: 0.75rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 18px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-light);
    flex-shrink: 0;
    margin-top: 4px;
    z-index: 1;
}

.timeline-item:last-child .timeline-dot {
    background: var(--secondary);
}

.timeline-item p {
    font-size: 0.85rem;
    color: var(--dark);
    flex: 1;
}

.timeline-time {
    font-size: 0.75rem;
    color: var(--gray);
    white-space: nowrap;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-pdf {
    background: #dc3545;
    color: var(--white);
}

.btn-pdf:hover {
    background: #c82333;
}

.hidden {
    display: none;
}

.empty-state {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    color: var(--gray);
    box-shadow: var(--shadow);
}

/* Footer */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 1rem 2rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--gray);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.view.hidden {
    display: none;
}

/* Wizard */
.wizard-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.wstep {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: var(--light);
    border: 1px solid var(--border);
    color: var(--gray);
    white-space: nowrap;
}

.wstep.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    font-weight: 600;
}

.wstep.done {
    background: #d4edda;
    color: #155724;
    border-color: #a3cfbb;
}

.wstep-panel h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.campo {
    margin-bottom: 1rem;
}

.campo label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.35rem;
}

.campo input,
.campo select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: var(--transition);
    background: var(--white);
    color: var(--dark);
}

.campo input:focus,
.campo select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(45, 90, 138, 0.15);
}

.campo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 1px solid var(--primary-light);
}

.btn-secondary:hover {
    background: var(--light);
}

.pct-live {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1.05rem;
    background: var(--light);
    border: 1px solid var(--border);
}

.pct-live.ok {
    background: #d4edda;
    color: #155724;
    border-color: #a3cfbb;
}

.pct-live.warn {
    background: #fff3cd;
    color: #856404;
    border-color: #ffe58a;
}

.acreedor-fila {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.acreedor-fila input {
    flex: 1;
    min-width: 140px;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.acreedor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.9rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.btn-acreedor-del {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

#acreedores-lista {
    margin-bottom: 0.75rem;
}

/* Resultado */
.resultado-ok,
.resultado-nok {
    margin-top: 0.25rem;
}

.resultado-ok h3 {
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.resultado-nok h3 {
    color: var(--danger);
    margin-bottom: 0.75rem;
}

.resultado-nok ul,
.alertas-lista {
    margin: 0.75rem 0 1rem 1.25rem;
    font-size: 0.9rem;
    color: var(--dark);
}

/* Salida amable: informe que recibe el ciudadano que no puede continuar.
   Nada de "rojo de error": es una guía seria, legible y con pasos. */
.salida-amable {
    background: var(--light, #f8fafc);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 1rem 1.15rem;
    margin-bottom: 1rem;
}

.salida-amable h3 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.salida-amable h4 {
    margin: 1rem 0 0.35rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--primary);
}

.salida-amable ol,
.salida-amable ul {
    margin: 0.25rem 0 0.5rem 1.25rem;
    font-size: 0.92rem;
    line-height: 1.6;
}

.salida-amable li {
    margin-bottom: 0.35rem;
}

.salida-amable .frase-clave {
    margin: 0.9rem 0 0.4rem;
    padding: 0.7rem 0.9rem;
    background: #eff6ff;
    border-radius: 6px;
    font-size: 0.95rem;
}

.salida-amable .motivo-texto {
    font-size: 0.95rem;
    line-height: 1.7;
}

.salida-amable .glosario {
    font-size: 0.85rem;
    color: var(--dark);
}

.salida-amable .recordatorios {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.salida-amable .recordatorios p {
    font-size: 0.85rem;
    color: var(--dark);
    margin-bottom: 0.35rem;
}

.detalle-motivo {
    margin: 0.75rem 0;
    font-size: 0.85rem;
}

.detalle-motivo summary {
    cursor: pointer;
    color: var(--dark);
}

.alertas-lista li {
    margin-bottom: 0.35rem;
}

.txt-danger { color: var(--danger); font-weight: 600; }
.txt-warn { color: #856404; font-weight: 600; }

.revision-provisional {
    background: #fbfbfd;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
}

.revision-header h4 {
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.revision-nota {
    font-size: 0.78rem;
    color: var(--gray);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
}

.revision-check {
    display: flex;
    gap: 0.6rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
}

.revision-check:last-of-type {
    border-bottom: none;
}

.revision-ico { font-size: 1rem; flex-shrink: 0; }
.revision-aprobado .revision-ico { color: var(--secondary); }
.revision-observacion .revision-ico { color: var(--warning); }
.revision-falla .revision-ico { color: var(--danger); }

.revision-texto strong {
    display: block;
    font-size: 0.85rem;
    color: var(--dark);
}

.revision-texto p {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Toast */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    color: var(--white);
    font-size: 0.875rem;
    box-shadow: var(--shadow-hover);
    animation: slide-in 0.25s ease;
}

.toast-success { background: var(--secondary); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary-light); }

@keyframes slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ── Plan A: avisos en línea junto al campo, resumen de revisión y
      confirmación visible del correo ── */

.campo.campo-error input,
.campo.campo-error select {
    border-color: var(--danger);
    background: #fff6f7;
}

.campo-error-msg {
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 0.35rem;
}

.resumen-bloque {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    margin-bottom: 0.9rem;
}

.resumen-bloque-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.resumen-bloque-head h4 {
    color: var(--primary);
    font-size: 0.95rem;
    margin: 0;
}

.resumen-lista {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.55rem;
}

.resumen-dato span {
    display: block;
    font-size: 0.68rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.resumen-dato strong {
    font-size: 0.92rem;
    color: var(--dark);
}

.btn-chico {
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
    white-space: nowrap;
}

.btn-lg {
    padding: 0.85rem 1.4rem;
    font-size: 1.02rem;
}

.email-estado {
    margin-top: 0.6rem;
    color: #155724;
    font-weight: 600;
    font-size: 0.88rem;
}