/* style.css - Versión corregida para el formulario profesional */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    min-height: 100vh;
    padding: 30px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center; /* solo centra horizontalmente */
}

.card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 600px;
    text-align: center;
    flex-shrink: 0;
}

.hidden {
    display: none !important; /* Esto es lo que arregla que no se vea todo junto */
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 15px;
}

textarea {
    height: 100px;
    resize: vertical;
}

button {
    width: 100%;
    padding: 15px;
    background: #0056b3;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    font-size: 16px;
}

button:hover {
    background: #004494;
}

.btn-secundario {
    background: #6c757d;
    margin-top: 8px;
}

.progress-bar {
    background: #e9ecef;
    height: 10px;
    border-radius: 5px;
    margin: 20px 0;
}

#progress {
    background: #0056b3;
    height: 100%;
    border-radius: 5px;
    transition: 0.4s;
}

label {
    display: block;
    text-align: left;
    font-size: 13px;
    color: #495057;
    font-weight: bold;
    margin-top: 15px;
}

.upload-group {
    background: #f8f9fa;
    padding: 15px;
    border: 1px dashed #bbb;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: left;
}

.error {
    color: #d9534f;
    font-size: 14px;
    margin-top: 10px;
}

/* ===== Autocompletado del conductor por DNI (Paso 2) ===== */
.dni-status {
    font-size: 12px;
    margin: -8px 0 10px;
    min-height: 16px;
    text-align: left;
    line-height: 1.35;
}
.dni-status.buscando { color: #666; font-style: italic; }
.dni-status.ok      { color: #0f5132; font-weight: bold; }
.dni-status.aviso   { color: #9c5700; }

/* Campo rellenado automaticamente desde el padron */
input.autocompletado {
    background: #f4fbf6;
    border-color: #28a745 !important;
}

/* Subtitulo para separar bloques dentro de un mismo paso */
.subtitulo-bloque {
    font-size: 13px;
    font-weight: bold;
    color: #0056b3;
    text-align: left;
    margin: 18px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e3e3e3;
}

/* Textarea de una sola linea de alto util (danos del tercero) */
textarea.txt-chico {
    min-height: 60px;
    height: 60px;
}

/* Ficha de un lesionado */
.lesionado-card {
    text-align: left;
    background: #fdf6f6;
    border: 1px solid #f0d8d8;
    border-left: 3px solid #d9534f;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}
.lesionado-card .lesionado-titulo {
    font-size: 12px;
    font-weight: bold;
    color: #9c0006;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.lesionado-card .quitar-lesionado {
    background: #d9534f;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 3px 9px;
    font-size: 11px;
    cursor: pointer;
}

.campo-hint {
    font-size: 11px;
    color: #9c5700;
    margin: -8px 0 10px;
    text-align: left;
    line-height: 1.35;
}

/* Notificaciones Inline */
#status-msg { padding: 15px; margin-bottom: 20px; border-radius: 8px; font-weight: bold; display: none; text-align: center; }
.status-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.status-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Modal de Confirmación */
.modal-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.6); display:flex; align-items:center; justify-content:center; z-index:2000; }
.modal-content { background: white; padding: 30px; border-radius: 12px; max-width: 450px; width: 90%; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.3); }

/* === Lista de denuncias previas en pantalla de seleccion === */
.sin-card {
    text-align: left;
    background: #f9f9f9;
    border: 1px solid #e3e3e3;
    border-left: 3px solid #6c757d;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.5;
}
.sin-card.ampliable {
    border-left-color: #28a745;
    background: #f4fbf6;
}
.sin-card .sin-info {
    color: #444;
    overflow-wrap: anywhere; /* corta strings sin espacios para que no se salga del card */
    word-break: break-word;
}
.sin-card .sin-info strong { color: #0056b3; }
.sin-card .btn-ampliar {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
}
.sin-card .btn-ampliar:hover { background: #218838; }
.sin-card .ampliable-hint {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #888;
    font-style: italic;
}

.chip {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-left: 6px;
}
.chip-externo { background: #cfe2ff; color: #084298; }
.chip-interno { background: #d1e7dd; color: #0f5132; }

.btn-ver-mas {
    width: 100%;
    margin: 6px 0 14px;
    padding: 10px;
    background: transparent;
    color: #0056b3;
    border: 1px dashed #0056b3;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
}
.btn-ver-mas:hover { background: #eaf2fb; }

/* === Previews de fotos viejas en step 5 (modo AMPLIACIÓN) === */
.fotos-viejas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.fotos-viejas:empty { display: none; }
.foto-vieja {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #ccc;
    background: #fff;
}
.foto-vieja img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.foto-vieja .quitar-foto {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    padding: 0;
    margin: 0;
    background: rgba(220, 53, 69, 0.92);
    color: white;
    border: none;
    border-radius: 50%;
    font-weight: bold;
    font-size: 12px;
    line-height: 22px;
    cursor: pointer;
}
.foto-vieja .quitar-foto:hover { background: #b02a37; }

/* === Banner que aparece arriba del form en modo AMPLIACIÓN === */
#banner-ampliacion {
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffe69c;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}
#banner-ampliacion span { color: #0056b3; }

/* === Croquis del siniestro (Paso 3) === */
.croquis-wrapper {
    width: 100%;
    max-width: 300px;
    margin: 8px auto 10px;
    border: 2px solid #ccc;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
    overflow: hidden;
}

#croquis-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    touch-action: none;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="black"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>') 2 20, default;
    background: #fff;
}

.croquis-controles {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}

.btn-croquis {
    width: auto;
    padding: 8px 16px;
    margin: 0;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
}
.btn-croquis:hover { background: #5a6268; }
.btn-croquis-rojo { background: #dc3545; }
.btn-croquis-rojo:hover { background: #c82333; }
