:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;          /* Reducido de 2rem */
    display: flex;
    flex-direction: column;
    /* Quitar min-height: 100vh */
}

/* Reducir espacio del header */
.header {
    text-align: center;
    margin-bottom: 1rem;    /* Reducido de 2rem */
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.logo h1 {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.subtitle {
    color: var(--gray-600);
    font-size: 1rem;
}

.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.form-card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;        /* Reducido de 2rem */
    width: 100%;
    max-width: 600px;
    border: 1px solid var(--gray-100);
}

.form-card h2 {
    color: var(--gray-900);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-description {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.medical-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

input, select {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: white;
    color: var(--gray-900);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.submit-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.result-container {
    margin-top: 1rem;       /* Reducido de 1.5rem */
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    animation: slideIn 0.3s ease-out;
}

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

.result-header {
    background: var(--gray-50);
    padding: 0.375rem 1rem;   /* Mitad de 0.75rem */
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.85rem;       /* Ligeramente más pequeño */
    line-height: 1.2;         /* Menos altura de línea */
}

.result-content {
    padding: 1rem;          /* Reducido de 1.5rem */
    text-align: center;
}

.prediction-value {
    font-size: 2.5rem;      /* Reducido de 3rem */
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;       /* Evitar exceso de altura */
}

.prediction-value.positive {
    color: var(--success);
}

.prediction-value.negative {
    color: var(--danger);
}

.prediction-label {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
    font-weight: 500;
}

.confidence-bar {
    width: 100%;
    height: 0.5rem;
    background: var(--gray-200);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 9999px;
    transition: width 0.5s ease-out;
}

.confidence-text {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.error-message {
    margin-top: 1rem;
    padding: 0.875rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    color: var(--danger);
    font-size: 0.9rem;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.footer {
    text-align: center;
    padding-top: 1rem;      /* Reducido de 2rem */
    color: var(--gray-500);
    font-size: 0.875rem;
}
.company-branding {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    display: block;
    /* Siempre a la izquierda, nunca centrado */
    text-align: left;
}

.nego-logo {
    height: 40px; /* Reducido un 30% (antes ~40px, ahora ~28px) */
    width: auto;
    opacity: 0.6; /* Opacidad inicial baja 0.9 */
    transition: opacity 0.3s ease, transform 0.2s ease;
    cursor: pointer;
}

.nego-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* Ajusta el container para que tenga posición relativa */
.container {
    position: relative;
    /* ... tus estilos actuales ... */
}

/* Opcional: ajustar el header para que no se superponga */
.header {
    margin-top: 20px;
    /* ... tus estilos actuales ... */
}


.nego-link {
    color: inherit; /* Mantiene el color del texto del footer */
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.nego-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}


/* Responsive: mantener a la izquierda en todos los tamaños */
@media (max-width: 768px) {
    .company-branding {
        left: 15px;
        top: 15px;
    }
    
    .nego-logo {
        height: 24px; /* Un poco más pequeño en móvil */
    }
}

