/* =========================================
   GENERAL
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    min-height: 100vh;
    font-family:
        Arial,
        Helvetica,
        sans-serif;
    background:
        radial-gradient(
            circle at top right,
            rgba(0,213,255,.18),
            transparent 30%
        ),
        radial-gradient(
            circle at bottom left,
            rgba(190,255,0,.14),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            #001b73 0%,
            #003de6 48%,
            #005bff 100%
        );
    padding: 28px;
    color: white;
}
.contenedor {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}
/* =========================================
   ENCABEZADO
========================================= */
.marca {
    text-align: center;
    margin-bottom: 22px;
}
.logo {
    width: 300px;
    max-width: 90%;
    height: auto;
    margin-bottom: 5px;
}
h1 {
    font-size: 46px;
    font-weight: 800;
    margin-top: 2px;
}
h1 span {
    color: #bdf000;
}
.subtitulo {
    margin-top: 7px;
    color: #dbe8ff;
    font-size: 15px;

}
/* =========================================
   DOS COLUMNAS
========================================= */
.panel-principal {
    display: grid;
    grid-template-columns:
        minmax(260px, 0.70fr)
        minmax(0, 1.30fr);
    gap: 22px;
    align-items: stretch;
}
/* =========================================
   TARJETAS
========================================= */
.tarjeta {
    background: white;
    color: #0b2559;
    border-radius: 20px;
    padding: 22px;
    box-shadow:
        0 18px 40px
        rgba(0,0,0,.18);
    min-height: 470px;
}
.tarjeta h2 {
    color: #003de6;
    font-size: 18px;
    margin-bottom: 6px;
}
.descripcion {
    color: #61708d;
    margin-bottom: 16px;
    line-height: 1.4;
    font-size: 14px;
}
/* =========================================
   ZONA DE CARGA COMPACTA
========================================= */
.upload-box {
    display: block;
    border:
        2px dashed #3a69ee;
    background:
        #f4f7ff;
    border-radius: 12px;
    padding: 10px 10px;
    text-align: center;
    cursor: pointer;
    transition: .25s;
}
.upload-box:hover {
    border-color: #9fcd00;
    background:
        #f9ffe9;
}
.icono {
    width: 36px;
    height: 36px;
    margin:
        0 auto 5px;
    border-radius: 50%;
    background:
        linear-gradient(
            135deg,
            #0044ef,
            #00a8ff
        );
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    color: white;
}
.upload-box strong {
    font-size: 14px;
}
input[type="file"] {
    display: none;
}
.seleccionar {
    display: inline-block;
    background:
        #003de6;
    color: white;
    padding:
        6px 11px;
    border-radius: 7px;
    font-weight: bold;
    margin-top: 5px;
    font-size: 12px;
}
#nombreArchivo {
    display: block;
    margin-top: 5px;
    color: #52617b;
    font-size: 10px;
}
.nota {
    margin-top: 4px;
    color: #61708d;
    font-size: 9px;
}
/* =========================================
   BOTÓN
========================================= */
button {
    width: 100%;
    margin-top: 10px;
    border: 0;
    border-radius: 9px;
    padding: 9px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    color: #08205c;
    background:
        linear-gradient(
            90deg,
            #bdf000,
            #d8ff55
        );
    transition:
        transform .2s ease;
}
button:hover {
    transform:
        translateY(-2px);
}
/* =========================================
   MENSAJES
========================================= */
.mensaje {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-weight: bold;
    font-size: 12px;
}
.ok {
    background: #eaffd6;
    color: #195500;
    border-left:
        4px solid #8ec400;
}
.error {
    background: #ffe4e7;
    color: #8a1220;
    border-left:
        4px solid #d8283a;
}
/* =========================================
   PREVIEW ANTES DE SUBIR
========================================= */
.preview {
    display: none;
    margin-top: 15px;
    text-align: center;
}
.preview h3 {
    color: #003de6;
    margin-bottom: 8px;
    font-size: 15px;
}
#previewImagen {
    display: block;
    width: 100%;
    max-width: 280px;
    max-height: 160px;
    object-fit: contain;
    margin: 0 auto;
    border-radius: 12px;
    border:
        1px solid #dbe5ff;
    background: white;
    padding: 5px;
}
/* =========================================
   IMAGEN GUARDADA
========================================= */
.imagen-cargada {
    margin-top: 16px;
    text-align: center;
}
.titulo-preview {
    color: #003de6;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
}
.imagen-cargada img {
    width: 100%;
    max-width: 280px;
    max-height: 160px;
    object-fit: contain;
    border-radius: 12px;
    border:
        1px solid #dbe5ff;
    background: white;
    padding: 5px;
}
/* =========================================
   PANEL DE IA
========================================= */
.panel-ia {
    display: flex;
    flex-direction: column;
}
.encabezado-ia {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}
.badge-ia {
    background:
        linear-gradient(
            135deg,
            #003de6,
            #00a8ff
        );
    color: white;
    padding:
        6px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
}
.resultado {
    flex: 1;
    background:
        #f6f8ff;
    border:
        1px solid #dce5ff;
    border-radius: 15px;
    padding: 24px;
    min-height: 380px;
    overflow-y: auto;
}
/* =========================================
   PANEL VACÍO
========================================= */
.analisis-vacio,
.estado-analisis {
    height: 100%;
    min-height: 330px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #64728f;
}
.icono-ia {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background:
        linear-gradient(
            135deg,
            #003de6,
            #00a8ff
        );
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    margin-bottom: 14px;
}
.analisis-vacio h3,
.estado-analisis h3 {
    color: #003de6;
    margin-bottom: 10px;
}
.analisis-vacio p,
.estado-analisis p {
    margin: 3px 0;
    line-height: 1.5;
    font-size: 14px;
}
/* =========================================
   FOOTER
========================================= */
footer {
    text-align: center;
    margin-top: 20px;
    color: #d8e3ff;
    font-size: 12px;
}
/* =========================================
   RESPONSIVE
========================================= */
@media (
    max-width: 850px
) {
    .panel-principal {
        grid-template-columns: 1fr;
    }
    .tarjeta {
        min-height: auto;
    }
    h1 {
        font-size: 38px;
    }
}
@media (
    max-width: 600px
) {
    body {
        padding: 15px;
    }
    .tarjeta {
        padding: 17px;
    }
}